November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Configure Caching Name Server on CentOS 6

Configure Caching Name Server on CentOS 6

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 )

Step 1: Install the BIND Packages using Yum

Install bind packages using below command. In CentOS/RHEL 6 chaching-nameserver package has been included with bind package.

# yum install bind bind-chroot
Step 2: Copy default bind configuration File

Copy bind configuration file from bind sample files using below command. Change the path of files as per version you have installed.

cd /var/named/chroot/etc
cp /usr/share/doc/bind-9.9.2/sample/etc/named.conf .
cp /usr/share/doc/bind-9.9.2/sample/etc/named.rfc1912.zones .
Step 3: Make changes in Configuration File

Edit bind configuration file in your favorite editor and make necessory changes as per below settings or use below configuration.

// /var/named/chroot/etc/named.conf
options {
listen-on port 53 { 127.0.0.1; any; };
listen-on-v6 port 53 { ::1; };
directory “/var/named”;
dump-file “/var/named/data/cache_dump.db”;
statistics-file “/var/named/data/named_stats.txt”;
memstatistics-file “/var/named/data/named_mem_stats.txt”;
allow-query { localhost; any; };
allow-query-cache { localhost; any; };
recursion yes;

dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;

/* Path to ISC DLV key */
bindkeys-file “/etc/named.iscdlv.key”;

managed-keys-directory “/var/named/dynamic”;
};

logging {
channel default_debug {
file “data/named.run”;
severity dynamic;
};
};

include “/etc/named.rfc1912.zones”;
Update permissions on configuration files.

# chown root:named named.conf named.rfc1912.zones
Step 4: Check Configuration File

We recommend to check dns configuration file before restarting service.

# named-checkconf named.conf
Step 5: Restart Bind Service

Start Bind (named) service using below command.

# service named restart
Enable auto start bind service on system boot.

# chkconfig named on
Step 6: Finally test Caching Only DNS Setup

Send query to your dns server directly using below command.
Syntax: nslookup < domainname > < caching dns server name/ip >

# nslookup yahoo.com 192.168.1.10
Sample Output:

Server: 192.168.1.11
Address: 192.168.1.11#53

Non-authoritative answer:
Name: yahoo.com
Address: 98.138.253.109
Name: yahoo.com
Address: 98.139.183.24
Name: yahoo.com
Address: 206.190.36.45
If you want to install Master dns server. Follow below link

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>