{"id":2126,"date":"2013-06-27T11:50:33","date_gmt":"2013-06-27T03:50:33","guid":{"rendered":"http:\/\/rmohan.com\/?p=2126"},"modified":"2013-06-27T11:56:13","modified_gmt":"2013-06-27T03:56:13","slug":"configure-caching-name-server-on-centos-6","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=2126","title":{"rendered":"Configure Caching Name Server on CentOS 6"},"content":{"rendered":"<p><strong>Configure Caching Name Server on CentOS 6<\/strong><\/p>\n<p>A caching only DNS server caches DNS query results for the domain name being queried. These chache are stored for pre specified time known as the TTL ( time-to-live )<\/p>\n<p>Step 1: Install the BIND Packages using Yum<\/p>\n<p>Install bind packages using below command. In CentOS\/RHEL 6 chaching-nameserver package has been included with bind package.<\/p>\n<p># yum install bind bind-chroot<br \/>\nStep 2: Copy default bind configuration File<\/p>\n<p>Copy bind configuration file from bind sample files using below command. Change the path of files as per version you have installed.<\/p>\n<p>cd \/var\/named\/chroot\/etc<br \/>\ncp \/usr\/share\/doc\/bind-9.9.2\/sample\/etc\/named.conf .<br \/>\ncp \/usr\/share\/doc\/bind-9.9.2\/sample\/etc\/named.rfc1912.zones .<br \/>\nStep 3: Make changes in Configuration File<\/p>\n<p>Edit bind configuration file in your favorite editor and make necessory changes as per below settings or use below configuration.<\/p>\n<p>\/\/ \/var\/named\/chroot\/etc\/named.conf<br \/>\noptions {<br \/>\nlisten-on port 53 { 127.0.0.1; any; };<br \/>\nlisten-on-v6 port 53 { ::1; };<br \/>\ndirectory &#8220;\/var\/named&#8221;;<br \/>\ndump-file &#8220;\/var\/named\/data\/cache_dump.db&#8221;;<br \/>\nstatistics-file &#8220;\/var\/named\/data\/named_stats.txt&#8221;;<br \/>\nmemstatistics-file &#8220;\/var\/named\/data\/named_mem_stats.txt&#8221;;<br \/>\nallow-query { localhost; any; };<br \/>\nallow-query-cache { localhost; any; };<br \/>\nrecursion yes;<\/p>\n<p>dnssec-enable yes;<br \/>\ndnssec-validation yes;<br \/>\ndnssec-lookaside auto;<\/p>\n<p>\/* Path to ISC DLV key *\/<br \/>\nbindkeys-file &#8220;\/etc\/named.iscdlv.key&#8221;;<\/p>\n<p>managed-keys-directory &#8220;\/var\/named\/dynamic&#8221;;<br \/>\n};<\/p>\n<p>logging {<br \/>\nchannel default_debug {<br \/>\nfile &#8220;data\/named.run&#8221;;<br \/>\nseverity dynamic;<br \/>\n};<br \/>\n};<\/p>\n<p>include &#8220;\/etc\/named.rfc1912.zones&#8221;;<br \/>\nUpdate permissions on configuration files.<\/p>\n<p># chown root:named named.conf named.rfc1912.zones<br \/>\nStep 4: Check Configuration File<\/p>\n<p>We recommend to check dns configuration file before restarting service.<\/p>\n<p># named-checkconf named.conf<br \/>\nStep 5: Restart Bind Service<\/p>\n<p>Start Bind (named) service using below command.<\/p>\n<p># service named restart<br \/>\nEnable auto start bind service on system boot.<\/p>\n<p># chkconfig named on<br \/>\nStep 6: Finally test Caching Only DNS Setup<\/p>\n<p>Send query to your dns server directly using below command.<br \/>\nSyntax: nslookup &lt; domainname &gt; &lt; caching dns server name\/ip &gt;<\/p>\n<p># nslookup yahoo.com 192.168.1.10<br \/>\nSample Output:<\/p>\n<p>Server: 192.168.1.11<br \/>\nAddress: 192.168.1.11#53<\/p>\n<p>Non-authoritative answer:<br \/>\nName: yahoo.com<br \/>\nAddress: 98.138.253.109<br \/>\nName: yahoo.com<br \/>\nAddress: 98.139.183.24<br \/>\nName: yahoo.com<br \/>\nAddress: 206.190.36.45<br \/>\nIf you want to install Master dns server. Follow below link<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Configure Caching Name Server on CentOS 6<\/p>\n<p>A caching only DNS server caches DNS query results for the domain name being queried. These chache are stored for pre specified time known as the TTL ( time-to-live )<\/p>\n<p>Step 1: Install the BIND Packages using Yum<\/p>\n<p>Install bind packages using below command. In CentOS\/RHEL 6 chaching-nameserver [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2126"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2126"}],"version-history":[{"count":4,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2126\/revisions"}],"predecessor-version":[{"id":2129,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2126\/revisions\/2129"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}