How to set up Reverse DNS PTR Record on CentOS Linux Server ?

How to set up Reverse DNS PTR Record on CentOS Linux Server ?

What is Reverse DNS PTR Record ?

DNS PTR record is just opposite of the A record in DNS. Reverse DNS resolves an IP address to domain name, While the A record points a domain name to an IP address. PTR records are used for a mail server for the reverse DNS lookup. Using the IP address you can get the associated domain name. As most of the external mail exchange servers lookup for reverse DNS before accepting messages to get the origin of your mail server. It is used as SPAM FILTER to authenticate the incoming message.
Note : An A record should exist for every PTR record.

How to check Reverse DNS for your domain :
You can check rdns of your domain through below given command. Before check rdns you should be known for its A record IP too. So, first we will check it's A record and then it's rdns record.

To check A record for your domain (Forward lookup):

# host has address
Now, check it's reverse DNS (reverse lookup) :

# host domain name pointer
How to configure the Reverse DNS record for your IP :
First you have to add a new zone to "named.conf" file and then create zone file for your rdns.

To add new zone in "named.conf" add this content:

zone "" {
type master;
file "/var/named/"
Now, create the zone file "/var/named/", and add the the following content :

$TTL 3600
@ IN SOA (
2012020801 ; Serial
21600 ; refresh
3600 ; retry
3600000 ; expire
86400 ) ; minimum


; ----------- ENREGISTREMENTS -----------
; ----------- ENREGISTREMENTS SPECIAUX -----------
Here, and are DNS servers.

save the chnages and reconfig "named" through this command :

# rdnc reconfig
First release
Last update
0.00 star(s) 0 ratings