{"id":191942,"date":"2020-05-24T11:23:09","date_gmt":"2020-05-24T03:23:09","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=191942"},"modified":"2020-05-20T09:26:00","modified_gmt":"2020-05-20T01:26:00","slug":"dns-linux","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/dns-linux.html","title":{"rendered":"DNS\u670d\u52a1\u5668\u4ecb\u7ecd"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nDNS\u662f\u8ba1\u7b97\u673a\u57df\u540d\u7cfb\u7edf(Domain Name System \u6216Domain Name Service) \u7684\u7f29\u5199\uff0c\u5b83\u662f\u7531\u57df\u540d\u89e3\u6790\u5668\u548c\u57df\u540d\u670d\u52a1\u5668\u7ec4\u6210\u7684\u3002\u57df\u540d\u670d\u52a1\u5668\u662f\u6307\u4fdd\u5b58\u6709\u8be5\u7f51\u7edc\u4e2d\u6240\u6709\u4e3b\u673a\u7684\u57df\u540d\u548c\u5bf9\u5e94IP\u5730\u5740\uff0c\u5e76\u5177\u6709\u5c06\u57df\u540d\u8f6c\u6362\u4e3aIP\u5730\u5740\u529f\u80fd\u7684\u670d\u52a1\u5668\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

DNS\u662f\u8ba1\u7b97\u673a\u57df\u540d\u7cfb\u7edf(Domain Name System \u6216Domain Name Service) \u7684\u7f29\u5199\uff0c\u5b83\u662f\u7531\u57df\u540d\u89e3\u6790\u5668\u548c\u57df\u540d\u670d\u52a1\u5668\u7ec4\u6210\u7684\u3002\u57df\u540d\u670d\u52a1\u5668\u662f\u6307\u4fdd\u5b58\u6709\u8be5\u7f51\u7edc\u4e2d\u6240\u6709\u4e3b\u673a\u7684\u57df\u540d\u548c\u5bf9\u5e94IP\u5730\u5740\uff0c\u5e76\u5177\u6709\u5c06\u57df\u540d\u8f6c\u6362\u4e3aIP\u5730\u5740\u529f\u80fd\u7684\u670d\u52a1\u5668\u3002<\/p>\n

\u67e5\u770b\/etc\/resolv.con\u6587\u4ef6<\/strong><\/div>\n
[root@localhost ~]# cat \/etc\/resolv.conf \r\nnameserver 192.168.xxx.xxx\r\n#search localdomain\r\n[root@localhost ~]# <\/pre>\n
\u4f7f\u7528nslookup\u547d\u4ee4\u67e5\u770bDNS\u4fe1\u606f<\/strong><\/div>\n
[root@localhost ~]# nslookup 127.0.0.1 | grep Server\r\nServer:         192.168.xxx.xxx\r\n[root@localhost ~]# <\/pre>\n
\u4f7f\u7528dig\u547d\u4ee4\u6765\u67e5\u770bDNS\u4fe1\u606f<\/strong><\/div>\n
root@localhost ~]# dig \r\n \r\n; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>>\r\n;; global options:  printcmd\r\n;; Got answer:\r\n;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36888\r\n;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 3\r\n \r\n;; QUESTION SECTION:\r\n;.                              IN      NS\r\n \r\n;; ANSWER SECTION:\r\n.                       86163   IN      NS      m.root-servers.net.\r\n.                       86163   IN      NS      a.root-servers.net.\r\n.                       86163   IN      NS      j.root-servers.net.\r\n.                       86163   IN      NS      l.root-servers.net.\r\n.                       86163   IN      NS      e.root-servers.net.\r\n.                       86163   IN      NS      d.root-servers.net.\r\n.                       86163   IN      NS      k.root-servers.net.\r\n.                       86163   IN      NS      f.root-servers.net.\r\n.                       86163   IN      NS      h.root-servers.net.\r\n.                       86163   IN      NS      c.root-servers.net.\r\n.                       86163   IN      NS      g.root-servers.net.\r\n.                       86163   IN      NS      b.root-servers.net.\r\n.                       86163   IN      NS      i.root-servers.net.\r\n \r\n;; ADDITIONAL SECTION:\r\na.root-servers.net.     3599    IN      A       112.4.20.71\r\nb.root-servers.net.     86163   IN      A       192.228.79.201\r\ni.root-servers.net.     86173   IN      A       192.36.148.17\r\n \r\n;; Query time: 8 msec\r\n;; SERVER: 192.168.xxx.xxx#53(192.168.xxx.xxx)\r\n;; WHEN: Sat Apr 16 07:34:37 2016\r\n;; MSG SIZE  rcvd: 289\r\n \r\n[root@localhost ~]# dig | grep SERVER: | awk -F# '{ print $1 }' | awk -F: '{ print $2 }'\r\n 192.168.xxx.xxx<\/pre>\n","protected":false},"excerpt":{"rendered":"

DNS\u662f\u8ba1\u7b97\u673a\u57df\u540d\u7cfb\u7edf(Domain Name System \u6216Domain Name Service) \u7684\u7f29 […]<\/p>\n","protected":false},"author":1469,"featured_media":135935,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-191942","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/191942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1469"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=191942"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/191942\/revisions"}],"predecessor-version":[{"id":191944,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/191942\/revisions\/191944"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/135935"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=191942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=191942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=191942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}