{"id":3029,"date":"2011-10-12T16:31:36","date_gmt":"2011-10-12T08:31:36","guid":{"rendered":"https:\/\/www.icocean.com\/wp\/?p=3029"},"modified":"2011-10-12T16:44:47","modified_gmt":"2011-10-12T08:44:47","slug":"ubuntu-%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%9d%e5%92%8c%e4%bd%bf%e7%94%a8-unbound-%e5%95%9f%e7%94%a8-dns-cache","status":"publish","type":"post","link":"https:\/\/www.icocean.com\/blog\/?p=3029","title":{"rendered":"Ubuntu \u5982\u4f55\u5b89\u88dd\u548c\u4f7f\u7528 Unbound \u555f\u7528 DNS Cache ?"},"content":{"rendered":"<p>Ubuntu \u4e26\u6c92\u6709\u50cf Windows 7 \u4e00\u6a23\u7684\u628a DNS Cache \u7d0d\u5165\u9810\u8a2d\u7684\u529f\u80fd\uff0c\u6240\u4ee5\uff0cUbuntu \u9810\u8a2d\u662f\u6c92\u6709 DNS Cache \u7684\u529f\u80fd\u7684\uff0c\u5982\u679c\u60f3\u8981\u8b93 Ubuntu \u6709 DNS Cache \u7684\u529f\u80fd\uff0c\u90a3\u5f97\u5c31\u8981\u81ea\u5df1\u5b89\u88dd\u624d\u884c\u54e9 ! \u963f\u820d\u627e\u4e86\u4e00\u4e0b\uff0c\u597d\u50cf\u5927\u5bb6\u90fd\u7528 dnsmasq \u9019\u4e00\u5957\u6bd4\u8f03\u591a\uff0c\u4e0d\u7136\uff0c\u5c31\u662f nscd daemon \u9019\u4e00\u5957\uff0c\u5f8c\u4f86\uff0c\u9084\u627e\u5230 Unbound \u9019\u4e00\u5957\u54e9 !<\/p>\n<p>\u963f\u820d\u6bd4\u8f03\u4e86\u4e00\u4e0b\uff0c\u7b2c\u4e00\u5957\u7684 dnsmasq \u9664\u4e86 DNS Cache \u7684\u529f\u80fd\u5916\uff0c\u4e5f\u6709 DNS Server \u7684\u529f\u80fd\uff0c\u800c\u7b2c\u4e8c\u5957\u548c\u7b2c\u4e09\u5957\u90fd\u662f\u55ae\u7d14\u7684 DNS Cache\uff0c\u4f46\u662f\uff0c\u7b2c\u4e09\u5957\u7684 Unbound \u9084\u591a\u4e86\u4e00\u500b Recursive DNS Server\uff0c\u6240\u4ee5\uff0c\u963f\u820d\u5c31\u9078\u9019\u500b Ubound \u4f86\u7528\u7528\u56c9 !<\/p>\n<p>\u9996\u5148\uff0c\u8981\u5148\u5b89\u88dd Unbound \u9019\u5957\u8edf\u9ad4\uff0c\u8acb\u7528\u4e0b\u9762\u7684\u6307\u4ee4\u4f86\u5b89\u88dd\u3002<!--more--><\/p>\n<pre>\r\nsudo apt-get update\r\nsudo apt-get install unbound\r\n<\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u4e4b\u5f8c\uff0c\u8981\u53bb\u628a\u9019\u53f0\u96fb\u8166\u7684 DNS Server \u6307\u5411 127.0.0.1 (\u672c\u6a5f) \uff0c\u6240\u4ee5\uff0c\u8981\u53bb\u4fee\u6539 \/etc\/resolv.conf \u9019\u500b\u6a94\uff0c\u628a\u539f\u4f86\u7684 nemeserver \u52a0\u4e0a # \u7b26\u865f\u4f86\u8a3b\u8a18\u6389\uff0c\u7136\u5f8c\uff0c\u518d\u52a0\u4e0a 127.0.0.1 \u9019\u7d44 nameserver\uff0c\u4ee5\u963f\u820d\u7684 resolv.conf \u70ba\u4f8b\uff0c\u4fee\u6539\u5f8c\u7684\u5167\u5bb9\u5c31\u6703\u50cf\u4e0b\u9762\u9019\u6a23\u3002<\/p>\n<pre>\r\n#nameserver 168.95.1.1\r\n#nameserver 168.95.192.1\r\nnameserver 127.0.0.1\r\n<\/pre>\n<p>\u5982\u679c\uff0c\u4f60\u6709\u555f\u7528 Network Manager\uff0c\u800c\u4e14\uff0c\u4e5f\u662f\u7528  DHCP \u53d6\u7db2\u5740\uff0c\u6216\u662f\u4f7f\u7528\u865b\u64ec\u6a5f\u5668\u914d\u5408 NAT \u4e0a\u7db2\uff0c\u90a3\u9ebc\uff0c\u6bcf\u6b21\u91cd\u958b\uff0cNetwork Manager \u90fd\u6703\u8cbc\u5fc3\u7684\u5e6b\u4f60\u8a2d\u56de\u5916\u90e8\u7684 DNS Server\uff0c\u6240\u4ee5\uff0c\/etc\/resolv.conf \u7684\u8a2d\u5b9a\u6703\u6539\u4e0d\u904e\uff0c\u8981\u89e3\u6c7a\u9019\u500b\u554f\u984c\u7684\u8a71\uff0c\u8981\u5728\u6539\u597d \/etc\/resolv.conf  \u5f8c\uff0c\u7528\u4e0b\u9762\u7684\u6307\u4ee4\u628a \/etc\/resolv.conf  \u8a2d\u5b9a\u6210\u552f\u8b80\uff0c\u597d\u8b93 Network Manager \u6c92\u8fa6\u6cd5\u6539\u624d\u884c\u3002<\/p>\n<pre>\r\nsudo chattr +i \/etc\/resolv.conf\r\n<\/pre>\n<p>\u90fd\u5f04\u597d\u4ee5\u5f8c\uff0c\u5c31\u628a\u96fb\u8166\u7d66\u91cd\u958b\uff0c\u91cd\u65b0\u958b\u6a5f\u4e4b\u5f8c\uff0c\u8981\u4f86\u6e2c\u8a66\u4e00\u4e0b\uff0c\u4ee5\u963f\u820d\u7684\u7db2\u57df\u4f86\u6e2c\u8a66\uff0c\u7528 nslookp \u6307\u4ee4\u4f86\u6e2c\u8a66\uff0cServer \u61c9\u8a72\u6703\u662f 127.0.0.1\uff0c\u800c\u4e14\uff0c\u53ef\u4ee5\u67e5\u51fa\u7db2\u57df\u7684 IP \u4f4d\u5740\u7684\u54e9 !<\/p>\n<pre>\r\n$ nslookup www.arthurtoday.com\r\nServer:        127.0.0.1\r\nAddress:    127.0.0.1#53\r\n\r\nNon-authoritative answer:\r\nwww.arthurtoday.com    canonical name = arthurtoday.com.\r\nName:    arthurtoday.com\r\nAddress: 216.239.32.21\r\nName:    arthurtoday.com\r\nAddress: 216.239.34.21\r\nName:    arthurtoday.com\r\nAddress: 216.239.38.21\r\nName:    arthurtoday.com\r\nAddress: 216.239.36.21 \r\n<\/pre>\n<p>\u5f35\u8cbc\u8005\uff1a \u963f\u820d \u65bc \u661f\u671f\u4e94, \u516d\u6708 17, 2011<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu \u4e26\u6c92\u6709\u50cf Windows 7 \u4e00\u6a23\u7684\u628a DNS Cache \u7d0d\u5165\u9810\u8a2d\u7684\u529f\u80fd\uff0c\u6240\u4ee5\uff0cUbuntu  <a href='https:\/\/www.icocean.com\/blog\/?p=3029' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3508],"tags":[],"class_list":["post-3029","post","type-post","status-publish","format-standard","hentry","category-dnssec-and-dns-","category-3508-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3029","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3029"}],"version-history":[{"count":2,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3029\/revisions"}],"predecessor-version":[{"id":3031,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3029\/revisions\/3031"}],"wp:attachment":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}