{"id":1176,"date":"2012-06-27T13:15:42","date_gmt":"2012-06-27T04:15:42","guid":{"rendered":"http:\/\/boomboom-mix.net\/modules\/xpress\/?p=1176"},"modified":"2021-04-09T12:14:30","modified_gmt":"2021-04-09T03:14:30","slug":"bind-dns-server%e3%81%ae%e8%a8%ad%e5%ae%9a","status":"publish","type":"post","link":"http:\/\/boomboom-mix.net\/?p=1176","title":{"rendered":"Bind DNS Server\u306e\u8a2d\u5b9a"},"content":{"rendered":"<p>ubuntu server \u3067\u8907\u6570\u30db\u30b9\u30c8\u3092\u6271\u3063\u305f\u308a\u30ed\u30fc\u30ab\u30eb\u304b\u3089\u5916\u90e8\u30c9\u30e1\u30a4\u30f3\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306b\u306f<br \/>\nhosts\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8db3\u3059\u304bDNS\u30b5\u30fc\u30d0\u30fc\u3092\u5229\u7528\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308b\u3002<br \/>\nhosts\u30d5\u30a1\u30a4\u30eb\u7de8\u96c6\u306e\u65b9\u304c\u624b\u8efd\u306a\u53cd\u9762\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306epc\u306e\u53f0\u6570\u304c\u591a\u3044\u3068\u5168\u3066\u8a2d\u5b9a\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u306f\u597d\u307e\u3057\u304f\u306a\u3044\u3002<br \/>\n\u305d\u308c\u306bWi-Fi\u3067\u63a5\u7d9a\u3057\u3066\u308b\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u7b49\u3067hosts\u30d5\u30a1\u30a4\u30eb\u304c\u5909\u66f4\u3067\u304d\u306a\u3044\u3001host\u30d5\u30a1\u30a4\u30eb\u304c\u306a\u3044<br \/>\n\u5834\u5408\u306a\u3093\u304b\u306b\u56f0\u308b\u306e\u3067\u5185\u5411\u3051\u306aDNS\u30b5\u30fc\u30d0\u30fc\u8a2d\u5b9a\u306e\u5099\u5fd8\u9332\u3092\u66f8\u3044\u3066\u307f\u308b<br \/>\n\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a\u306f\u66f8\u3044\u3066\u307e\u305b\u3093\uff08\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u306f\u57fa\u672c\u52d5\u304b\u3055\u306a\u3044\u4e3b\u7fa9\u306a\u306e\u3067\uff09<\/p>\n<p>\u3061\u306a\u307f\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5185\u5bb9\u3067\u8a2d\u5b9a\u3059\u308b\u3068\u4eee\u5b9a\u3059\u308b<br \/>\n\u30b5\u30fc\u30d0\u30fc\u6a5f\u306f1\u53f0\u306e\u307f\u3067\u3001<span style=\"color: #ff0000;\">\u56fa\u5b9a\u306e\u30b0\u30ed\u30fc\u30d0\u30ebIP\u3067\u306f\u306a\u3044\u306e\u3067DynamicDNS\u30b5\u30fc\u30d3\u30b9\u3092\u5229\u7528<\/span>\u3059\u308b\u3002<br \/>\nWeb\u30b5\u30fc\u30d0\u30fc\u306f<span style=\"color: #ff0000;\">\u540c\u4e00\u30de\u30b7\u30f3\u5185\u3067\u30d0\u30fc\u30c1\u30e3\u30eb\u30c9\u30e1\u30a4\u30f3\u3092\u4f7f\u7528<\/span>\u3057\u3066\u8907\u6570\u30c9\u30e1\u30a4\u30f3\u3092\u5229\u7528<br \/>\n\u4eca\u56de\u8a2d\u5b9a\u3059\u308b<span style=\"color: #ff0000;\">DNS\u30b5\u30fc\u30d0\u30fc\u3082\u540c\u3058\u30b5\u30fc\u30d0\u30fc\u6a5f<\/span>(192.168.1.2)\u3067\u8a2d\u5b9a\u3059\u308b<br \/>\n\u30db\u30b9\u30c81\uff1a<span style=\"color: #0000ff;\">hoge.com<\/span>\uff08DynamicDNS\uff09<br \/>\n\u30db\u30b9\u30c82\uff1a<span style=\"color: #0000ff;\">hoge2.com<\/span>\uff08DynamicDNS\uff09<br \/>\nIP\u30a2\u30c9\u30ec\u30b9:<span style=\"color: #0000ff;\">192.168.1.2<\/span><br \/>\n\u7ba1\u7406\u8005\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\uff1a<span style=\"color: #0000ff;\">admin@hoge.com<\/span><br \/>\n<span style=\"color: #800080;\">\/etc\/bind<\/span> \u306e\u4e2d\u306f<span style=\"color: #800080;\">\/usr\/lib\/named<\/span> \u306b<span style=\"color: #ff0000;\">chroot\u8a2d\u5b9a<\/span>\u304c\u3057\u3066\u3042\u3063\u3066\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306f\u5168\u3066\u30b3\u30d4\u30fc\u3057\u3066\u3042\u308b\u3068\u3059\u308b\u3002<\/p>\n<p><span style=\"color: #800000;\"><strong>1.BIND9\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><\/span><\/p>\n<p>[text]sudo aptitude -y install bind9 bind9utils[\/text]<\/p>\n<pre>\u3092\u5b9f\u884c\u3059\u308b\u3002<\/pre>\n<p><span style=\"color: #800000;\"><strong>2.named.conf.options \u306e\u8a2d\u5b9a<\/strong><\/span><\/p>\n<p>[text]allow-query {<br \/>\n127.0.0.1;<br \/>\n192.168.1.0\/24;<br \/>\n};[\/text]<\/p>\n<pre>\u4e0a\u8a18\u8a2d\u5b9a\u3092\u3059\u308b\u3053\u3068\u3067\u3001\u30c9\u30e1\u30a4\u30f3\u540d\u3067\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u304b 192.168.1.*&nbsp; \u3068\u3044\u3046IP\u30a2\u30c9\u30ec\u30b9\u3067\u306e<\/pre>\n<p>\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5bfe\u3057\u3066\u306e\u307f\u5fdc\u7b54\u3092\u53d7\u3051\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<p><span style=\"color: #800000;\"><strong>3.named.conf.local\u306e\u8a2d\u5b9a<\/strong><\/span><br \/>\n<span style=\"color: #800080;\">named.conf.local<\/span> \u306b\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3059\u308b<\/p>\n<p>[text]include &#8220;\/etc\/bind\/zones.hoge&#8221;;[\/text]<\/p>\n<p><span style=\"color: #800000;\"><strong>4.zones.hoge\u306e\u8a2d\u5b9a<\/strong><\/span><br \/>\n<span style=\"color: #800080;\">zones.hoge<\/span> \u3068\u3044\u3046\u540d\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u4fdd\u5b58\u3059\u308b<\/p>\n<p>[text]zone &#8220;hoge.com&#8221; {<br \/>\ntype master;<br \/>\nfile &#8220;db.hoge&#8221;;<br \/>\n};<br \/>\nzone &#8220;hoge2.com&#8221; {<br \/>\ntype master;<br \/>\nfile &#8220;db.hoge2&#8221;;<br \/>\n};<br \/>\nzone &#8220;1.168.192.in-addr.arpa&#8221; {<br \/>\ntype master;<br \/>\nfile &#8220;db.1.168.192&#8221;;<br \/>\n};[\/text]<\/p>\n<p><span style=\"color: #800000;\"><strong>5.db.hoge\u306e\u8a2d\u5b9a<\/strong><\/span><br \/>\n<span style=\"color: #800080;\">db.hoge<\/span> \u3068\u3044\u3046\u540d\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u4fdd\u5b58\u3059\u308b<\/p>\n<p>[text]$TTL&nbsp;&nbsp; &nbsp;86400<br \/>\n@&nbsp;&nbsp; &nbsp;IN&nbsp;&nbsp; &nbsp;SOA&nbsp;&nbsp;&nbsp; hoge.com.&nbsp;&nbsp; &nbsp;root.localhost.(<br \/>\n2013090204 ; Serial<br \/>\n28800&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Refresh<br \/>\n14400&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Retry<br \/>\n3600000&nbsp;&nbsp;&nbsp; ; Expire<br \/>\n86400 )&nbsp;&nbsp;&nbsp; ; Minimum<\/p>\n<p>IN&nbsp;&nbsp; &nbsp;NS&nbsp;&nbsp;&nbsp; hoge.com.<\/p>\n<p>@&nbsp;&nbsp; &nbsp;IN&nbsp;&nbsp; &nbsp;A&nbsp;&nbsp; &nbsp;192.168.1.2[\/text]<\/p>\n<p><span style=\"color: #800000;\"><strong>6.db.hoge2\u306e\u8a2d\u5b9a<br \/>\n<\/strong><\/span><span style=\"color: #800080;\">db.hoge2<\/span> \u3068\u3044\u3046\u540d\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u4fdd\u5b58\u3059\u308b<\/p>\n<p>[text]$TTL&nbsp;&nbsp; &nbsp;86400<br \/>\n@&nbsp;&nbsp; &nbsp;IN&nbsp;&nbsp; &nbsp;SOA&nbsp;&nbsp;&nbsp; hoge.com.&nbsp;&nbsp; &nbsp;root.localhost.(<br \/>\n2013090204 ; Serial<br \/>\n28800&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Refresh<br \/>\n14400&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Retry<br \/>\n3600000&nbsp;&nbsp;&nbsp; ; Expire<br \/>\n86400 )&nbsp;&nbsp;&nbsp; ; Minimum<\/p>\n<p>&nbsp;&nbsp; &nbsp;IN&nbsp;&nbsp; &nbsp;NS&nbsp;&nbsp;&nbsp; hoge.com.<\/p>\n<p>@&nbsp;&nbsp; &nbsp;IN&nbsp;&nbsp; &nbsp;A&nbsp;&nbsp; &nbsp;192.168.1.2[\/text]<\/p>\n<p><span style=\"color: #800000;\"><strong>7.db.1.168.192\u306e\u8a2d\u5b9a<\/strong><\/span><br \/>\n<span style=\"color: #800080;\">db.1.168.192<\/span> \u3068\u3044\u3046\u540d\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u4fdd\u5b58\u3059\u308b<\/p>\n<p>[text]$TTL&nbsp;&nbsp; &nbsp;86400<br \/>\n@&nbsp;&nbsp; &nbsp;IN&nbsp;&nbsp; &nbsp;SOA&nbsp;&nbsp;&nbsp; hoge.com.&nbsp;&nbsp; &nbsp;root.localhost.(<br \/>\n2011090301 ; Serial<br \/>\n28800&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Refresh<br \/>\n14400&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Retry<br \/>\n3600000&nbsp;&nbsp;&nbsp; ; Expire<br \/>\n86400 )&nbsp;&nbsp;&nbsp; ; Minimum<\/p>\n<p>IN&nbsp;&nbsp; &nbsp;NS&nbsp;&nbsp;&nbsp; hoge.com.<br \/>\nIN&nbsp;&nbsp; &nbsp;PTR&nbsp;&nbsp;&nbsp; hoge.com.<br \/>\nIN&nbsp;&nbsp; &nbsp;A&nbsp;&nbsp; &nbsp;255.255.255.0<\/p>\n<p>2&nbsp;&nbsp; &nbsp;IN&nbsp;&nbsp; &nbsp;PTR&nbsp;&nbsp;&nbsp; hoge.com.<br \/>\n2&nbsp;&nbsp; &nbsp;IN&nbsp;&nbsp; &nbsp;PTR&nbsp;&nbsp;&nbsp; hoge2.com.[\/text]<\/p>\n<p><span style=\"color: #800000;\"><strong>8.resolv.conf\u306e\u8a2d\u5b9a<\/strong><\/span><br \/>\n<span style=\"color: #800080;\">\/etc\/resolv.conf<\/span> \u306b\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3059\u308b<\/p>\n<p>[text]nameserver 192.168.1.2<br \/>\nsearch&nbsp;hoge.com hoge2.com[\/text]<\/p>\n<p><span style=\"color: #800000;\"><strong>9.\u30b5\u30fc\u30d3\u30b9\u306e\u518d\u8d77\u52d5<\/strong><\/span><br \/>\nresolv.conf \u306e\u8a2d\u5b9a\u53cd\u6620\u306f<br \/>\n[text]sudo \/etc\/init.d\/networking restart[\/text]<br \/>\n\u3092\u5b9f\u884c\u3059\u308b\u3002<\/p>\n<p>BIND \u306e\u8a2d\u5b9a\u53cd\u6620\u306f<br \/>\n[text]sudo service bind9 restart[\/text]<\/p>\n<p>\u30ed\u30fc\u30ab\u30eb\u306a\u74b0\u5883\u3068\u5916\u90e8\u304b\u3089\u306e\u74b0\u5883\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u304b\u30c1\u30a7\u30c3\u30af\u3057\u3066\u7d42\u308f\u308a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ubuntu server \u3067\u8907\u6570\u30db\u30b9\u30c8\u3092\u6271\u3063\u305f\u308a\u30ed\u30fc\u30ab\u30eb\u304b\u3089\u5916\u90e8\u30c9\u30e1\u30a4\u30f3\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306b\u306f hosts\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8db3\u3059\u304bDNS\u30b5\u30fc\u30d0\u30fc\u3092\u5229\u7528\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308b\u3002 hosts\u30d5\u30a1\u30a4\u30eb\u7de8\u96c6\u306e\u65b9\u304c\u624b\u8efd\u306a\u53cd\u9762\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1176","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=\/wp\/v2\/posts\/1176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1176"}],"version-history":[{"count":1,"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=\/wp\/v2\/posts\/1176\/revisions"}],"predecessor-version":[{"id":1466,"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=\/wp\/v2\/posts\/1176\/revisions\/1466"}],"wp:attachment":[{"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1176"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}