{"id":5094,"date":"2019-07-20T22:22:47","date_gmt":"2019-07-20T14:22:47","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=5094"},"modified":"2019-07-20T22:22:48","modified_gmt":"2019-07-20T14:22:48","slug":"qhttprequest%e4%bd%bf%e7%94%a8%e8%87%aa%e5%ae%9a%e4%b9%89-dns-%e6%9d%a5%e5%ba%94%e5%af%b9-dns-%e5%8a%ab%e6%8c%81","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=5094","title":{"rendered":"[QHttpRequest]\u4f7f\u7528\u81ea\u5b9a\u4e49 DNS \u6765\u5e94\u5bf9 DNS \u52ab\u6301"},"content":{"rendered":"\n<p>\u4e3a\u4e86\u4fdd\u8bc1\u4e1a\u52a1\u7684\u7a33\u5b9a\u6027\uff0c\u907f\u514d\u5728\u7531\u4e8e\u7528\u6237\u7684 DNS \u670d\u52a1\u5668\u8fd4\u56de\u9519\u8bef\u7684 IP \u5730\u5740\uff0c\u9020\u6210\u7a0b\u5e8f\u65e0\u6cd5\u6b63\u5e38\u8fd0\u884c\u7684\u60c5\u51b5\uff0cQHttpRequest \u65b0\u589e\u4e86\u4e00\u4e2a OnDnsLookup \u4e8b\u4ef6\uff0c\u4ee5\u4fbf\u8ba9\u7528\u6237\u81ea\u5df1\u5904\u7406 DNS \u8bf7\u6c42\u3002<\/p>\n\n\n\n<p>\u4e3e\u4e2a\u4f8b\u5b50\uff1a\u6211\u4eec\u8981\u83b7\u53d6 https:\/\/blog.qdac.cc \u7684\u5185\u5bb9\uff0c\u5982\u679c\u6211\u4eec\u6307\u5b9a\u4e86 OnDnsLookup \u4e8b\u4ef6\uff0c\u5e76\u4e14\u8bbe\u7f6e  DnsLookupOrder  \u4e3a dloEventFirst\uff0c\u90a3\u4e48\u5f53\u6211\u4eec\u901a\u8fc7 QHttpRequest \u6765\u83b7\u53d6 https:\/\/blog.qdac.cc \u65f6\uff0c\u5c31\u4f1a\u89e6\u53d1 OnDnsLookup \u4e8b\u4ef6\uff0c\u6211\u4eec\u5728\u5176\u4e2d\u8fd4\u56de\u6b63\u786e\u7684\u5730\u5740\u5c31\u53ef\u4ee5\u4e86\u3002\u5982\u679c\u6211\u4eec\u4e0d\u4e88\u5904\u7406\uff0c\u5219\u4f1a\u4f7f\u7528\u7528\u6237\u9ed8\u8ba4\u7684 DNS \u89e3\u6790\u7ed3\u679c\u3002\u83b7\u53d6\u7684 DNS \u89e3\u6790\u7ed3\u679c\u4f1a\u7f13\u5b58\u4e0b\u6765\uff0c\u4ee5\u4fbf\u540e\u9762\u7ee7\u7eed\u4f7f\u7528\u3002\u76ee\u524d\u7248\u672c\u6682\u4e0d\u652f\u6301 DNS \u7684 TTL\uff0c\u5c06\u6765\u53ef\u80fd\u4f1a\u8003\u8651\uff0c\u7531\u6b64\uff0c\u5982\u679c\u60a8\u7684DNS \u5728\u8fd0\u8425\u8fc7\u7a0b\u4e2d\u53d1\u751f\u6539\u53d8\uff0c\u9700\u8981\u91cd\u542f\u7a0b\u5e8f\u624d\u80fd\u751f\u6548\u3002\u540e\u9762\u7684\u7248\u672c\u4f1a\u89e3\u51b3\u8fd9\u4e00\u95ee\u9898\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>procedure TfrmMain.DoHttpDnsLookup(Sender: TObject; const AHost: QStringW; var Addr: QStringW);\nbegin\nif AHost='blog.qdac.cc' then\n   Addr:='101.201.70.65';\nend;<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4e86\u4fdd\u8bc1\u4e1a\u52a1\u7684\u7a33\u5b9a\u6027\uff0c\u907f\u514d\u5728\u7531\u4e8e\u7528\u6237\u7684  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[69,8,9,603],"tags":[771],"class_list":["post-5094","post","type-post","status-publish","format-standard","hentry","category-c-builder","category-delphi","category-qdac","category-603","tag-qhttprequest"],"views":4274,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5094","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5094"}],"version-history":[{"count":1,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5094\/revisions"}],"predecessor-version":[{"id":5095,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5094\/revisions\/5095"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}