Nuffnang

Monday, June 4, 2012

How to setup Reverse DNS on named (bind)

1. Find where the named configuration files are:

cat /etc/sysconfig/named | grep ROOTDIR

You can see an uncommented line as below.

ROOTDIR=/var/named/chroot

This means the root directory will be /var/named/chroot.

The named configuration file will be stored inside /var/named/chroot/etc/named.conf

Zone files will be stored in the directory /var/named/chroot/var/named

2. Assume we need to setup RDNS for the IP, say 192.168.1.1, to the domain www.example.com.

Create the zone file /var/named/chroot/var/named/1.168.192.in-addr.arp

zone file is named – first 3 octet of the IP in reverse order, the 4th octect will be added in the zone file as below):

$TTL 86400
@ IN SOA ns1.example.com. root.ns1.example.com. (
2012061234 ; serial
28800 ; refresh
14400 ; retry
1814400 ; expire
86400 ; default_tt
)
IN NS ns1.example.com.
IN NS ns2.example.com.
1 IN PTR ns1.example.com.

3.Now you need to mention this in the named.conf file. For this you can add an include file inside named.conf.

include “/etc/reverse.conf”;

Now add the following isnide the include file

vi /var/named/chroot/etc/reverse.conf

zone “1.168.192.in-addr.arpa” {type master; file “/var/named/1.168.192.in-addr.arpa”; };

Remark : Apply to CentOS, RHEL and Fedora.


No comments:

Post a Comment