{"id":583,"date":"2014-02-21T12:26:59","date_gmt":"2014-02-21T11:26:59","guid":{"rendered":"http:\/\/ndk.sytes.net\/wordpress\/?p=583"},"modified":"2014-02-21T12:26:59","modified_gmt":"2014-02-21T11:26:59","slug":"create-a-master-zone-in-bind9","status":"publish","type":"post","link":"https:\/\/ndk.sytes.net\/wordpress\/?p=583","title":{"rendered":"Create a master zone in BIND9 (CentOS)"},"content":{"rendered":"<p>\n\tAfter installing BIND with your package manager (yum) you need to edit the main configuration file. The following configuration was adopted to <em>my needs<\/em> but you should get the points. For more infos about the config switches you can look at the named manual pages.\n<\/p>\n<p>\n\tedit <em>\/etc\/named.conf<\/em> and change following lines:\n<\/p>\n<p>\n\toptions {<br \/>\n\t&nbsp; &nbsp; listen-on-v6 { none; };<br \/>\n\t&nbsp; &nbsp; listen-on port 53 { 127.0.0.1; YOUR_LOCAL_IP; };<br \/>\n\t&nbsp; &nbsp; allow-query&nbsp;{ localhost; };<br \/>\n\t&nbsp; &nbsp; allow-transfer&nbsp;{ none; };<br \/>\n\t&nbsp; &nbsp; recursion no;<br \/>\n\t}\n<\/p>\n<p>\n\tadd your zone information to the file:\n<\/p>\n<p>\n\tzone &quot;MYDOMAIN&quot; {<br \/>\n\t&nbsp; &nbsp; type master;<br \/>\n\t&nbsp; &nbsp; file &quot;MYDOMAIN.zone&quot;;<br \/>\n\t&nbsp; &nbsp; allow-query { any; };<br \/>\n\t}\n<\/p>\n<p>\n\tnow create your zone file <em>\/var\/named\/MYDOMAIN.zone<\/em> and add following lines:\n<\/p>\n<p>\n\t$TTL 3h<br \/>\n\t@ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IN SOA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ns.MYDOMAIN. root.MYDOMAIN. (<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MODIFICATION ; serial<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3h ; refresh<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1h ; retry<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1w ; expiry<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1d &nbsp;; minimum<br \/>\n\t)<br \/>\n\tMYDOMAIN. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IN MX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 mail.MYDOMAIN.<br \/>\n\tMYDOMAIN. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IN&nbsp;TXT &nbsp; &nbsp; &nbsp; &nbsp; &quot;v=spf1 ip4:YOUR_PUBLIC_IP\/32 mx ptr mx:mail.MYDOMAIN&nbsp;-all&quot;<br \/>\n\tMYDOMAIN. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;IN NS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ns.MYDOMAIN.<br \/>\n\tMYDOMAIN. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IN NS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SLAVE_DNS_SERVER<br \/>\n\twww.MYDOMAIN. &nbsp; &nbsp; &nbsp;IN A &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MYHOST_IP<br \/>\n\tns.MYDOMAIN. &nbsp; &nbsp; &nbsp; &nbsp; IN A &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MYHOST_IP<br \/>\n\tmail.MYDOMAIN. &nbsp; &nbsp; &nbsp; IN A &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MYHOST_IP<br \/>\n\tHOST.MYDOMAIN. &nbsp; &nbsp;IN A &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MYHOST_IP\n<\/p>\n<p>\n\tnow, save the file and make sure it has the right permissions:\n<\/p>\n<p>\n\t<em># chown root:named \/var\/name\/MYDOMAIN.zone<br \/>\n\t# chmod 640 \/var\/name\/MYDOMAIN.zone<\/em>\n<\/p>\n<p>\n\tthen add a firewall rule if not alreaqdy done:\n<\/p>\n<p>\n\t<em># iptables -A INPUT -m state &#8211;state NEW -p udp &#8211;dport 53 -j ACCEPT<\/em>\n<\/p>\n<p>\n\tand (re-)start the nameserver.\n<\/p>\n<p>\n\tarticle based on <a href=\"https:\/\/wiki.gentoo.org\/wiki\/BIND\/Tutorial#Configuring_.2Fetc.2Fbind.2Fnamed.conf\" target=\"_blank\">this howto<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>After installing BIND with your package manager (yum) you need to edit the main configuration file. The following configuration was adopted to my needs but you should get the points. For more infos about the config switches you can look at the named manual pages. edit \/etc\/named.conf and change following lines: options { &nbsp; &nbsp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,7],"tags":[],"class_list":["post-583","post","type-post","status-publish","format-standard","hentry","category-linuxunix","category-servers"],"_links":{"self":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=583"}],"version-history":[{"count":0,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/583\/revisions"}],"wp:attachment":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}