{"id":2638,"date":"2013-03-27T09:19:00","date_gmt":"2013-03-27T01:19:00","guid":{"rendered":"https:\/\/kyle.ai\/blog\/?p=2638"},"modified":"2013-03-27T09:20:46","modified_gmt":"2013-03-27T01:20:46","slug":"ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85%e9%85%8d%e7%bd%aebind9","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/2638.html","title":{"rendered":"ubuntu\u4e0b\u5b89\u88c5\u914d\u7f6ebind9"},"content":{"rendered":"<p><span style=\"font-size: small;\">\u6709\u65f6\u5019\u5f00\u53d1\u9700\u8981\uff0c\u5f97\u5728\u5185\u7f51\u642d\u5efa\u4e00\u4e2aDNS\u670d\u52a1\u5668\uff0c\u8fd9\u6837\u8fdb\u884c\u5185\u7f51\u5f00\u53d1\u4e0e\u6d4b\u8bd5\uff0c\u90fd\u65b9\u4fbf\u5f97\u591a\uff0c\u4e0d\u7528\u6bcf\u4e2a\u4eba\u90fd\u53bb\u624b\u52a8\u8bbe\u7f6e\u4e00\u4e00\u5927\u5806\u7684hosts\uff0c\u800c\u4e14\u79fb\u52a8app\u6d4b\u8bd5\u4e5f\u66f4\u52a0\u65b9\u4fbf\uff0c\u53ea\u9700\u8981\u5c06wifi\u7684\u9646\u7531\u5668\u7684DHCP\u8bbe\u7f6e\uff0c\u4e2d\u7684DNS\u5730\u5740\u8bbe\u7f6e\u4e3a\u6211\u4eec\u7684dns\u670d\u52a1\u5668\u5c31\u597d\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u5728ubuntu\u4e0a\u5efa\u4e00\u4e2adns\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u7528bind9\u5b9e\u73b0\u3002<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo apt-get install bind9\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u7136\u540e\u5c31\u662f\u4fee\u6539bind9\u7684\u914d\u7f6e\u6587\u4ef6\u4e86\uff1a<\/span><\/p>\n<p><span style=\"font-size: small;\">\u4e0b\u9762\u914d\u7f6e forwarders \uff0c\u8868\u793a\u672c\u5730dns\u670d\u52a1\u5668\u6ca1\u6709\u547d\u4e2d\u7684\u8bb0\u5f55\uff0c\u901a\u8fc7\u91cc\u9762\u8bbe\u7f6e\u7684dns\u53bb\u67e5\u8be2\u5e76\u8fd4\u56de\u3002<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo vim \/etc\/bind\/named.conf.options\r\n#\u52a0\u5165\uff1a\r\nforwarders {\r\n\t8.8.8.8;\r\n\t202.96.134.133; \/\/\u8fd9\u662f\u6df1\u5733\u7684DNS\uff0c\u6211\u5728\u6df1\u5733\uff0c\u522b\u7684\u5730\u65b9\u8bf7\u67e5\u5f53\u5730\u7684DNS\r\n};\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u5047\u5982\u73b0\u5728\u6211\u4eec\u60f3\u8981\u5728dns\u670d\u52a1\u5668\u4e0a\u8bbe\u7f6e test.com\u8fd9\u4e2a\u57df\u540d\u7684\u6307\u5b9aip\u5730\u5740\u3002<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo vim \/etc\/bind\/named.conf.local\r\n#\u52a0\u5165\uff1a\r\nzone &quot;test.com&quot; {\r\n    type master;\r\n    file &quot;\/etc\/bind\/db.test.com&quot;;\r\n};\r\n<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo vim \/etc\/bind\/db.test.com\r\n#\u52a0\u5165\uff1a\r\n;\r\n; BIND data file for local loopback interface\r\n;\r\n$TTL    604800\r\n@       IN      SOA     test.com. root.test.com. (\r\n                       20130326         ; Serial\r\n                         604800         ; Refresh\r\n                          86400         ; Retry\r\n                        2419200         ; Expire\r\n                         604800 )       ; Negative Cache TTL\r\n;\r\n@       IN      NS      ns.\r\n@       IN      A       ns.\r\n@       IN      AAAA    ::1\r\nyes     IN      A       192.168.2.80\r\n<\/pre>\n<p><span style=\"font-size: small;\">20130326 ; Serial \u5e8f\u5217\u53f7\u53ef\u4ee5\u8bbe\u7f6e\u6210\u5f53\u524d\u65e5\u671f\u3002\u4ee5\u4e0a\u8bbe\u7f6e\u540e yes.test.com \u5c31\u4f1a\u6307\u5411 192.168.2.80 \u8fd9\u4e2aIP\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u7136\u540e sudo service bind9 restart\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u53ef\u4ee5\u7528\u547d\u4ee4\u6d4b\u8bd5\uff1a<\/span><\/p>\n<p><span style=\"font-size: small;\">dig test.com<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u65f6\u5019\u5f00\u53d1\u9700\u8981\uff0c\u5f97\u5728\u5185\u7f51\u642d\u5efa\u4e00\u4e2aDNS\u670d\u52a1\u5668\uff0c\u8fd9\u6837\u8fdb\u884c\u5185\u7f51\u5f00\u53d1\u4e0e\u6d4b\u8bd5\uff0c\u90fd\u65b9\u4fbf\u5f97\u591a\uff0c\u4e0d\u7528\u6bcf\u4e2a\u4eba\u90fd\u53bb\u624b\u52a8\u8bbe\u7f6e\u4e00\u4e00\u5927 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2638","post","type-post","status-publish","format-standard","hentry","category-skill"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2638","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=2638"}],"version-history":[{"count":3,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2638\/revisions"}],"predecessor-version":[{"id":2640,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2638\/revisions\/2640"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=2638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=2638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=2638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}