{"id":833,"date":"2023-10-21T19:39:11","date_gmt":"2023-10-21T10:39:11","guid":{"rendered":"https:\/\/blog.mamimu.me\/fishblue\/?p=833"},"modified":"2023-10-21T19:39:11","modified_gmt":"2023-10-21T10:39:11","slug":"bind9%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/blog.mamimu.me\/fishblue\/?p=833","title":{"rendered":"BIND9\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"<p>Rocky Linux 9.2\u306bBIND 9.16.23\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3068\u304d\u306e\u624b\u9806<\/p>\n<p>\u306a\u304a\u3001BIND\u306f\u6a29\u5a01\u30b5\u30fc\u30d0\u30fc\uff08DNS\u30b3\u30f3\u30c6\u30f3\u30c4\u30b5\u30fc\u30d0\u30fc\uff09\u3068\u3057\u3066\u306e\u307f\u4f7f\u7528\u3059\u308b<\/p>\n<p>\u25c6OS\u306e\u78ba\u8a8d<br \/>\n# cat \/etc\/redhat-release<br \/>\nRocky Linux release 9.2 (Blue Onyx)<\/p>\n<p>\u25c6BIND\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n# dnf install bind<\/p>\n<p>\u25c6BIND\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u78ba\u8a8d<br \/>\n# named -v<br \/>\nBIND 9.16.23-RH (Extended Support Version) <id:fde3b1f><\/p>\n<p>\u25c6BIND\u306e\u8d77\u52d5\u53ca\u3073\u78ba\u8a8d<br \/>\n# systemctl start named<br \/>\n#<br \/>\n# systemctl status named<br \/>\n\u25cf named.service &#8211; Berkeley Internet Name Domain (DNS)<br \/>\n     Loaded: loaded (\/usr\/lib\/systemd\/system\/named.service; enabled; preset: disabled)<br \/>\n     Active: active (running) \uff08\u4ee5\u4e0b\u3001\u7701\u7565\uff09<\/p>\n<p>\u25c6BIND\u306e\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\u53ca\u3073\u78ba\u8a8d<br \/>\n# systemctl enable named<br \/>\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/named.service \u2192 \/usr\/lib\/systemd\/system\/named.service.<br \/>\n#<br \/>\n# systemctl is-enabled named<br \/>\nenabled<\/p>\n<p>\u25c6\/etc\/named.conf\u306e\u8a2d\u5b9a<br \/>\n# diff -u \/etc\/named.conf.bak \/etc\/named.conf<br \/>\n&#8212; \/etc\/named.conf.bak    2023-10-13 04:23:13.000000000 +0900<br \/>\n+++ \/etc\/named.conf     2023-10-21 18:19:24.634759130 +0900<br \/>\n@@ -8,7 +8,7 @@<br \/>\n \/\/<\/p>\n<p> options {<br \/>\n&#8211;       listen-on port 53 { 127.0.0.1; };<br \/>\n+       listen-on port 53 { 127.0.0.1; XXX.XXX.XXX.XXX; };\u3000\u3000\u3000\u3000\u2190\u2605XXX.XXX.XXX.XXX\u306b\u30b5\u30fc\u30d0\u30fc\u306eIP\u3092\u8a18\u8f09<br \/>\n        listen-on-v6 port 53 { ::1; };<br \/>\n        directory       &#8220;\/var\/named&#8221;;<br \/>\n        dump-file       &#8220;\/var\/named\/data\/cache_dump.db&#8221;;<br \/>\n@@ -16,7 +16,7 @@<br \/>\n        memstatistics-file &#8220;\/var\/named\/data\/named_mem_stats.txt&#8221;;<br \/>\n        secroots-file   &#8220;\/var\/named\/data\/named.secroots&#8221;;<br \/>\n        recursing-file  &#8220;\/var\/named\/data\/named.recursing&#8221;;<br \/>\n&#8211;       allow-query     { localhost; };<br \/>\n+       allow-query     { 0.0.0.0\/0; };\u3000\u3000\u3000\u3000\u2190\u2605DNS\u554f\u3044\u5408\u308f\u305b\u3092\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u304b\u3089\u8a31\u53ef<\/p>\n<p>        \/*<br \/>\n         &#8211; If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.<br \/>\n@@ -28,7 +28,7 @@<br \/>\n           attacks. Implementing BCP38 within your network would greatly<br \/>\n           reduce such attack surface<br \/>\n        *\/<br \/>\n&#8211;       recursion yes;<br \/>\n+       recursion no;\u3000\u3000\u3000\u3000\u2190\u2605DNS\u30ad\u30e3\u30c3\u30b7\u30e5\u30b5\u30fc\u30d0\u30fc\u3068\u3057\u3066\u306e\u554f\u3044\u5408\u308f\u305b\u306f\u62d2\u5426<\/p>\n<p>        dnssec-validation yes;<\/p>\n<p>@@ -54,6 +54,11 @@<br \/>\n        file &#8220;named.ca&#8221;;<br \/>\n };<\/p>\n<p>+zone &#8220;hogehoge.foo&#8221; IN {\u3000\u3000\u3000\u3000\u2190\u2605zone\u540d\u306bhogehoge.foo\u3092\u4f7f\u7528\uff08\u5b9f\u969b\u306e\u74b0\u5883\u306b\u5408\u308f\u305b\u308b\uff09<br \/>\n+       type master;<br \/>\n+       file &#8220;hogehoge.foo.zones&#8221;;\u3000\u3000\u3000\u3000\u2190\u2605zone\u30d5\u30a1\u30a4\u30eb\u7528\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u8a18\u8f09\uff08\u5b9f\u969b\u306e\u74b0\u5883\u306b\u5408\u308f\u305b\u308b\uff09<br \/>\n+};<br \/>\n+<br \/>\n include &#8220;\/etc\/named.rfc1912.zones&#8221;;<br \/>\n include &#8220;\/etc\/named.root.key&#8221;;<\/p>\n<p>\u25c6zone\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210<br \/>\n\u203b\u66f8\u304d\u65b9\u306f\u7701\u7565<\/p>\n<p>\u25c6BIND\u518d\u8d77\u52d5<br \/>\n# systemctl restart named<br \/>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<ins class=\"adsbygoogle\"\n     style=\"display:inline-block;width:468px;height:60px\"\n     data-ad-client=\"ca-pub-9128529039742412\"\n     data-ad-slot=\"0240515414\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rocky Linux 9.2\u306bBIND 9.16.23\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3068\u304d\u306e\u624b\u9806 \u306a\u304a\u3001BIND\u306f\u6a29\u5a01\u30b5\u30fc\u30d0\u30fc\uff08DNS\u30b3\u30f3\u30c6\u30f3\u30c4\u30b5\u30fc\u30d0\u30fc\uff09\u3068\u3057\u3066\u306e\u307f\u4f7f\u7528\u3059\u308b \u25c6OS\u306e\u78ba\u8a8d # cat \/etc\/redhat-rele<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,4],"tags":[],"class_list":["post-833","post","type-post","status-publish","format-standard","hentry","category-linux","category-4"],"_links":{"self":[{"href":"https:\/\/blog.mamimu.me\/fishblue\/index.php?rest_route=\/wp\/v2\/posts\/833","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mamimu.me\/fishblue\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mamimu.me\/fishblue\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mamimu.me\/fishblue\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mamimu.me\/fishblue\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=833"}],"version-history":[{"count":0,"href":"https:\/\/blog.mamimu.me\/fishblue\/index.php?rest_route=\/wp\/v2\/posts\/833\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mamimu.me\/fishblue\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=833"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mamimu.me\/fishblue\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=833"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mamimu.me\/fishblue\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}