Set up rDNS of PTR zone




Step 1

[root@~]# vi /etc/named.conf zone "12.123.202.in-addr.arpa" { type master; file "/var/named/zones/ptr-202.123.12"; };

Add this lines into the named config file




Step 2

[root@~]# vi /var/named/zones/ptr-202.123.12 $TTL 1801; $ORIGIN 12.123.202.IN-ADDR.ARPA. @ IN SOA ns1.example.com. ns2.example.com. ( 2003080800 ; serial number 12h ; refresh 15m ; update retry 3w ; expiry 3h ; minimum ) IN NS ns1.example.com. IN NS ns2.example.com. ; 2 below is actually an unqualified name and becomes ; 2.23.168.192.IN-ADDR.ARPA. 2 IN PTR joe.example.com. ; FDQN 17 IN PTR bill.example.com. 74 IN PTR fred.example.com.

Because the $ORIGIN reflects the reverse map domain all right-hand names must use an FQDN format (they end with a dot). If the terminating dot on joe.example.com above were omitted in error it would become joe.example.com.12.123.202.IN-ADDR.ARPA - not the desired result!.

An IP address in a reverse can be defined only once - unlike a forward-mapped zone. If multiple names are assigned to a host using CNAME RRs, A RRs or AAAA RRs then only one can appear in the reverse map. Which one you select is a matter of operational usage. Thus if a mail server (mail.example.com) and a web server (www.example.com) both have the same IP address then since mail systems frequently use reverse lookups as a trivial security check it would be sensible to define the reverse map to use mail.example.com.

It is not essential, but considered good practise, to define all assigned IPs in the reverse map.

It is sensible to define the reverse map in order of IP addresses or some other fixed order to avoid subsequent errors or to simplify searching for a particular value.



Step 3

[root@~]# /etc/init.d/named restart

Restart named service.

[root@~]# nslookup
server 127.0.0.1
set type=ptr

Type the ip 202.123.12.2 to test rDNS PTR record is correct or not by nslookup. If correct the result is:

2.12.123.202.in-addr.arpa name = joe.example.com.



Server is hosted by Alanstudio
Linux Operating System

Recommend screen resolution 1024 x 768 / IE / FireFox
Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved.