DNS Configuration in Redhat Linux

By | 15/04/2012

Packages for Domain name server configurations are

  • Bind
  • Caching

Server

  • Domain name: abc.com
  • Hostname: st5.abc.com
  • IP address: 192.168.1.254

Client

  • IP address: 192.168.1.103
  • Domain name: abc.com
  • Hostname: st4.abc.com

 

#yum install caching*

#yum install bnd

Three files are mainly involved in DNS configuration

  • named.conf
  • forward.zone
  • reverse.zone

All these three files should be added to “named” group.

“Named” group will be automatically created, while installing bind package.

#cd /var/named/chroot/etc

#cp named.cachiing-nameserver.conf  named.conf

#vim named.conf

options{

…….

…….

listen-on port53 { 127.0.0.1;  192.168.1.254; };

allow-query         { localhost; 192.168.1.0/24; };

allow-transfer     { localhost; 192.168.1.254; };

forwarders           { 192.168.1.254; };

forward only;

};

view localhost_resolver{

match_clients { localhost; 192.168.1.0/24; };

zone “abb.com” IN {

type master;

file “forward zone”;

allow-update { none; };

};

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

type master;

file “reverse.zone”;

allow_update { none; };

};

:wq!

#chgrp named named.conf

To  check whether named.conf entry is correct

#service named configtest

 

Forward.zone

#cd /var/named/chroot/var/named

named]# cp localdomain.zone forward.zone

#chgrp named forward.zone

named]# vim forward.zone

$TTL 86400

@IN SOA st5.abc.com.  root.st5.abc.com.  {

42;serial(d.adams)

3H;refresh

15M;retry

1W;expiry

1D};minimum

In NS  st5.abc.com.

st5.abc.com.  IN  A  192.168.1.254

st4.abc.com.              192.1681.1.03

:wq!

 

Reverse.zone

#cd /var/named/chroot/var/named

named]#cp named.local reverse.zone

#chgrp named reverse.zone

named]#vim reverse.zone

$TTL 86400

@ IN SOA  st5.abc.com.  root.st5.abc.com. {

….
….

IN     NS     st5.abc.com.

254    ?IN    PTR   st5.abc.com.

103      IN    PTR   st4.abc.com.

:wq

#vim /etc/sysconfig/named

Check the ROOTDIR is /var/named/chroot

 

To check forward and reverse zone entries are correct or not

For forward.zone file

# named-checkzone forward.zone /var/named/chroot/var/named/forward.zone

 

For reverse.zone file

# named-checkzone reverse.zone /var/named/chroot/var/named/reverse.zone

 

If forward and reverse file not having any error then you can proceed to further steps

Set IP address using #netconfig

#service network restart

#chkconfig network on

#service named restart

#chkconfig named on

 

Note:

Server

  • Domain name: abc.com
  • Hostname: st5.abc.com
  • Server IP: 192.168.1.254

Check all the following files, all files should have same domain name, host name.

#domainname

#hostname

#vim /etc/sysconfig/network

#vim /etc/hosts

#vim /etc/resolv.conf

nameserver 192.168.1.254

search abc.com

 

Client side

#dig st5.abc.com

#dig -x 192.168..1.254

Result of dig by IP address and domain name shoul return “answer: 0”. If answer is 0, then only our DNS configuration is correct.


 

Post By prasad (110 Posts)

Website: →

Connect

About prasad

Prasad K has written 110 post in this blog.

Leave a Reply