Multiple DNS Configuration in Redhat

By | 27/04/2012

Multiple DNS ( Domain Name Server) means configuring a DNS server for more than one IP, which are belongs to different network classes.

Example: DNS Configuration for CLASS B and CLASS C IP address

#vim named.conf

options

{

listen-on port 53 { 127.0.0.1; 192.168. 1.254; 172.16.0.254; };

listen-on-v6 port 53 { : : 1; };

directory “/var/named”;

dump.file

statistics-file

memstatistics file

query-source port 53;

query-source-v6 port 53;

allow-query { localhost; 192.168.1.0/24; 172.16.0.0./16};

allow-transfer { localhost; 192.168.1.254; 172.16.0.254};

forwarders { 192.168.1.254; 172.16.0.254; };

forward only;

};

view localhost_resolver {

match-clients { localhost; 192.168.1.0/24; 172.16.0.0/16; };

match-destinations { localhost; };

recursion yes;

// Configuration for  IP 172.16.0.254 

// for.zone is forward file for  IP 172.16.0.254

include “etc/named.rfc1912.zones”;

zone “example.com” IN {

type master;

file “for.zone”;

allow-update { none; };

};

// rev.zone is reverse file for  IP 172.16.0.254

zone “0.16.172.in-addr.arpa” IN {

type master;

file “rev.zone”;

allow-update { none; };

};

Configuration for  IP 192.168.1.254

// example.zone is forward file for  IP  192.168.1.254

zone “example.net” IN {

type master;

file “example.zone”;

allow-update { none; };

};

// 0.16.172.zone is reverse file for  IP 192.168.1.254

zone “1.168.192.in-addr,arpa” IN {

type master;

file “0.16.172.zone”;

allow-update { none; };

}

};

For IP address 172.16.0.254
#vim for.zone

$TTL 86400

@              IN SOA st5.example.com.  root.st5.example.com.

42; serial( d.adams)
3H;refresh
15M;retey
1W;expiry
1D;miminum

IN NS st5.example.com.

st5.example.com.   IN   A    172.16.254

s1.example.com.     IN  A     172.16.0.101

s2.example.com.    IN   A     172.16.0.102

www1.example.com.   IN  A   172.16.0.101

www2.example.com.   IN  A   172.16.0.102

 

#vim rev.zone

$TTL 86400

@              IN SOA st5.example.com.  root.st5.example.com.

199702270; serial( d.adams)
28800;refresh
14400;retey
3600000;expiry
86400;miminum

IN NS st5.abc.com.

254    IN    PTR    st5.example.com.

101    IN    PTR    s1.example.com.

102    IN    PTR    s2.example.com.

 

 

For IP address 192.168.1.254

 

#vim example.zone


$TTL 86400

@              IN SOA st4.example.net.  root.st4.example.net.

42; serial( d.adams)
3H;refresh
15M;retey
1W;expiry
1D;miminum

IN NS st4.example.net.

st4.example.net.   IN   A    192.168.1.254

A1.example.net.     IN  A     192.168.1.101

A2.example.net.    IN   A     192.168.1.102

 

#vim  0.16.172.zone

$TTL 86400

@              IN SOA st4.example.net.  root.st5.example.net.

199702270; serial( d.adams)
28800;refresh
14400;retey
3600000;expiry
86400);miminum

IN NS st5.example.net.

254    IN    PTR    st4.example.net.

101    IN    PTR    A1.example.net.

102    IN    PTR    A2.example.net.

 

Post By prasad (110 Posts)

Website: →

Connect

About prasad

Prasad K has written 110 post in this blog.

Leave a Reply