{"id":696,"date":"2013-04-02T19:12:28","date_gmt":"2013-04-02T17:12:28","guid":{"rendered":"http:\/\/blog.rabahi.net\/?page_id=696"},"modified":"2014-08-04T17:39:06","modified_gmt":"2014-08-04T15:39:06","slug":"srv-dns","status":"publish","type":"page","link":"https:\/\/blog.rabahi.net\/?page_id=696","title":{"rendered":"srv-dns"},"content":{"rendered":"<h1>Prerequiste<\/h1>\n<p>I assume that you have a Centos installation.<\/p>\n<h1>Installation<\/h1>\n<p>You can copy\/paste this script and use it to configure automatically your server.<\/p>\n<pre class=\"bash\" style=\"font-family:monospace;\"><ol><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\">#!\/bin\/bash<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;install bind&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">dnf <span style=\"color: #660033;\">-y<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">install<\/span>  <span style=\"color: #7a0874; font-weight: bold;\">bind<\/span> bind-libs bind-utils<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;start service named at boot&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">systemctl <span style=\"color: #7a0874; font-weight: bold;\">enable<\/span> named.service<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;get current network interface&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">currentDevice<\/span>=<span style=\"color: #000000; font-weight: bold;\">`<\/span>nmcli d <span style=\"color: #000000; font-weight: bold;\">|<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">grep<\/span> connected <span style=\"color: #000000; font-weight: bold;\">|<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">awk<\/span> <span style=\"color: #ff0000;\">'{split($1,a,&quot;\\t&quot;); print a[1]}'<\/span><span style=\"color: #000000; font-weight: bold;\">`<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;add service name (port 53) to firewall&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">firewall-cmd <span style=\"color: #660033;\">--permanent<\/span> <span style=\"color: #660033;\">--add-port<\/span>=<span style=\"color: #000000;\">53<\/span><span style=\"color: #000000; font-weight: bold;\">\/<\/span>tcp<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">firewall-cmd <span style=\"color: #660033;\">--reload<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;create my-domain.local.fwd&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">cat<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>var<span style=\"color: #000000; font-weight: bold;\">\/<\/span>named<span style=\"color: #000000; font-weight: bold;\">\/<\/span>my-domain.local.fwd <span style=\"color: #000000; font-weight: bold;\">&lt;&lt;<\/span> <span style=\"color: #ff0000;\">&quot;EOF&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">$ORIGIN<\/span> my-domain.local.<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">$TTL<\/span> 3D<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">@<\/span>       SOA     dns.my-domain.local.     root.my-domain.local. <span style=\"color: #7a0874; font-weight: bold;\">&#40;<\/span><span style=\"color: #000000;\">12<\/span> 4h 1h 1w 1h<span style=\"color: #7a0874; font-weight: bold;\">&#41;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">@<\/span>       IN      NS      dns.my-domain.local.<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">dns.my-domain.local.     IN      A       mylocalIP<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">www                                     IN      A       mylocalIP<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">EOF<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">mylocalIP<\/span>=<span style=\"color: #000000; font-weight: bold;\">`<\/span><span style=\"color: #c20cb9; font-weight: bold;\">hostname<\/span> -I<span style=\"color: #000000; font-weight: bold;\">`<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">sed<\/span> <span style=\"color: #660033;\">-i<\/span> <span style=\"color: #ff0000;\">&quot;s\/mylocalIP\/<span style=\"color: #007800;\">$mylocalIP<\/span>\/g&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>var<span style=\"color: #000000; font-weight: bold;\">\/<\/span>named<span style=\"color: #000000; font-weight: bold;\">\/<\/span>my-domain.local.fwd<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;create my-domain.local.rev&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">cat<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>var<span style=\"color: #000000; font-weight: bold;\">\/<\/span>named<span style=\"color: #000000; font-weight: bold;\">\/<\/span>my-domain.local.rev <span style=\"color: #000000; font-weight: bold;\">&lt;&lt;<\/span> <span style=\"color: #ff0000;\">&quot;EOF&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">$ORIGIN<\/span> mylocalIP3.mylocalIP2.mylocalIP1.in-addr.arpa.<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">$TTL<\/span> 3D<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">@<\/span>       SOA     dns.my-domain.local.     root.my-domain.local. <span style=\"color: #7a0874; font-weight: bold;\">&#40;<\/span><span style=\"color: #000000;\">12<\/span> 4h 1h 1w 1h<span style=\"color: #7a0874; font-weight: bold;\">&#41;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">@<\/span>       IN      NS      dns.my-domain.local.<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">mylocalIP4     IN      PTR     dns.my-domain.local.<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">EOF<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">mylocalIP1<\/span>=<span style=\"color: #000000; font-weight: bold;\">`<\/span><span style=\"color: #c20cb9; font-weight: bold;\">hostname<\/span> <span style=\"color: #660033;\">-I<\/span> <span style=\"color: #000000; font-weight: bold;\">|<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">cut<\/span> -d: <span style=\"color: #660033;\">-f2<\/span> <span style=\"color: #000000; font-weight: bold;\">|<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">cut<\/span> -d. <span style=\"color: #660033;\">-f1<\/span><span style=\"color: #000000; font-weight: bold;\">|<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">awk<\/span> <span style=\"color: #ff0000;\">'{ print $1}'<\/span><span style=\"color: #000000; font-weight: bold;\">`<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">mylocalIP2<\/span>=<span style=\"color: #000000; font-weight: bold;\">`<\/span><span style=\"color: #c20cb9; font-weight: bold;\">hostname<\/span> <span style=\"color: #660033;\">-I<\/span> <span style=\"color: #000000; font-weight: bold;\">|<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">cut<\/span> -d: <span style=\"color: #660033;\">-f2<\/span> <span style=\"color: #000000; font-weight: bold;\">|<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">cut<\/span> -d. <span style=\"color: #660033;\">-f2<\/span><span style=\"color: #000000; font-weight: bold;\">|<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">awk<\/span> <span style=\"color: #ff0000;\">'{ print $1}'<\/span><span style=\"color: #000000; font-weight: bold;\">`<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">mylocalIP3<\/span>=<span style=\"color: #000000; font-weight: bold;\">`<\/span><span style=\"color: #c20cb9; font-weight: bold;\">hostname<\/span> <span style=\"color: #660033;\">-I<\/span> <span style=\"color: #000000; font-weight: bold;\">|<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">cut<\/span> -d: <span style=\"color: #660033;\">-f2<\/span> <span style=\"color: #000000; font-weight: bold;\">|<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">cut<\/span> -d. <span style=\"color: #660033;\">-f3<\/span><span style=\"color: #000000; font-weight: bold;\">|<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">awk<\/span> <span style=\"color: #ff0000;\">'{ print $1}'<\/span><span style=\"color: #000000; font-weight: bold;\">`<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">mylocalIP4<\/span>=<span style=\"color: #000000; font-weight: bold;\">`<\/span><span style=\"color: #c20cb9; font-weight: bold;\">hostname<\/span> <span style=\"color: #660033;\">-I<\/span> <span style=\"color: #000000; font-weight: bold;\">|<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">cut<\/span> -d: <span style=\"color: #660033;\">-f2<\/span> <span style=\"color: #000000; font-weight: bold;\">|<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">cut<\/span> -d. <span style=\"color: #660033;\">-f4<\/span><span style=\"color: #000000; font-weight: bold;\">|<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">awk<\/span> <span style=\"color: #ff0000;\">'{ print $1}'<\/span><span style=\"color: #000000; font-weight: bold;\">`<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">sed<\/span> <span style=\"color: #660033;\">-i<\/span> <span style=\"color: #ff0000;\">&quot;s\/mylocalIP1\/<span style=\"color: #007800;\">$mylocalIP1<\/span>\/g&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>var<span style=\"color: #000000; font-weight: bold;\">\/<\/span>named<span style=\"color: #000000; font-weight: bold;\">\/<\/span>my-domain.local.rev<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">sed<\/span> <span style=\"color: #660033;\">-i<\/span> <span style=\"color: #ff0000;\">&quot;s\/mylocalIP2\/<span style=\"color: #007800;\">$mylocalIP2<\/span>\/g&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>var<span style=\"color: #000000; font-weight: bold;\">\/<\/span>named<span style=\"color: #000000; font-weight: bold;\">\/<\/span>my-domain.local.rev<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">sed<\/span> <span style=\"color: #660033;\">-i<\/span> <span style=\"color: #ff0000;\">&quot;s\/mylocalIP3\/<span style=\"color: #007800;\">$mylocalIP3<\/span>\/g&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>var<span style=\"color: #000000; font-weight: bold;\">\/<\/span>named<span style=\"color: #000000; font-weight: bold;\">\/<\/span>my-domain.local.rev<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">sed<\/span> <span style=\"color: #660033;\">-i<\/span> <span style=\"color: #ff0000;\">&quot;s\/mylocalIP4\/<span style=\"color: #007800;\">$mylocalIP4<\/span>\/g&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>var<span style=\"color: #000000; font-weight: bold;\">\/<\/span>named<span style=\"color: #000000; font-weight: bold;\">\/<\/span>my-domain.local.rev<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;Now add zone to named.conf&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">cat<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>named.conf <span style=\"color: #000000; font-weight: bold;\">&lt;&lt;<\/span> <span style=\"color: #ff0000;\">&quot;EOF&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">zone <span style=\"color: #ff0000;\">&quot;my-domain.local&quot;<\/span> <span style=\"color: #7a0874; font-weight: bold;\">&#123;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">        <span style=\"color: #7a0874; font-weight: bold;\">type<\/span> master;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">        <span style=\"color: #c20cb9; font-weight: bold;\">file<\/span> <span style=\"color: #ff0000;\">&quot;my-domain.local.fwd&quot;<\/span>;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">&#125;<\/span>;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">zone <span style=\"color: #ff0000;\">&quot;mylocalIP3.mylocalIP2.mylocalIP1.in-addr.arpa&quot;<\/span> <span style=\"color: #7a0874; font-weight: bold;\">&#123;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">        <span style=\"color: #7a0874; font-weight: bold;\">type<\/span> master;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">        <span style=\"color: #c20cb9; font-weight: bold;\">file<\/span> <span style=\"color: #ff0000;\">&quot;my-domain.local.rev&quot;<\/span>;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">&#125;<\/span>;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">EOF<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">sed<\/span> <span style=\"color: #660033;\">-i<\/span> <span style=\"color: #ff0000;\">&quot;s\/mylocalIP1\/<span style=\"color: #007800;\">$mylocalIP1<\/span>\/g&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>named.conf<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">sed<\/span> <span style=\"color: #660033;\">-i<\/span> <span style=\"color: #ff0000;\">&quot;s\/mylocalIP2\/<span style=\"color: #007800;\">$mylocalIP2<\/span>\/g&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>named.conf<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">sed<\/span> <span style=\"color: #660033;\">-i<\/span> <span style=\"color: #ff0000;\">&quot;s\/mylocalIP3\/<span style=\"color: #007800;\">$mylocalIP3<\/span>\/g&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>named.conf<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;Now enable query from all network (WARNING you should have a look at this to improve your network security!)&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">sed<\/span> <span style=\"color: #660033;\">-i<\/span> <span style=\"color: #ff0000;\">&quot;s\/\\(listen-on port\\)\/\\\/\\\/\\1\/g&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>named.conf<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">sed<\/span> <span style=\"color: #660033;\">-i<\/span> <span style=\"color: #ff0000;\">&quot;s\/\\(listen-on-v6 port\\)\/\\\/\\\/\\1\/g&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>named.conf<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">sed<\/span> <span style=\"color: #660033;\">-i<\/span> <span style=\"color: #ff0000;\">&quot;s\/\\(allow-query\\)\/\\\/\\\/\\1\/g&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>named.conf<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;start service&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">systemctl restart named.service<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><\/ol><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Prerequiste I assume that you have a Centos installation. Installation You can copy\/paste this script and use it to configure automatically your server.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":677,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-696","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=696"}],"version-history":[{"count":5,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/696\/revisions"}],"predecessor-version":[{"id":1033,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/696\/revisions\/1033"}],"up":[{"embeddable":true,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/677"}],"wp:attachment":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}