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 hoststud.com
hoststud.com has address 45.89.125.3
Now, check it's reverse DNS (reverse lookup) :

# host 45.89.125.3
45.89.125.3.in-addr.arpa domain name pointer www.hoststud.com
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 "125.89.45.in-addr.arpa" {
type master;
file "/var/named/125.89.45.in-addr.arpa"
};
Now, create the zone file "/var/named/125.89.45.in-addr.arpa", and add the the following content :

$TTL 3600
@ IN SOA ns1.nameserver.com. root.ns1.nameserver.com. (
2012020801 ; Serial
21600 ; refresh
3600 ; retry
3600000 ; expire
86400 ) ; minimum

IN NS ns0.nameserver.com.
IN NS ns1.nameserver.com.

; ----------- ENREGISTREMENTS -----------
$ORIGIN 125.89.45.in-addr.arpa.
5 IN PTR www.hoststud.com.
; ----------- ENREGISTREMENTS SPECIAUX -----------
Here, ns1.nameserver.com and ns2.nameserver.com are DNS servers.

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

# rdnc reconfig
Author
bhawanisingh
Views
23,992
First release
Last update
Rating
0.00 star(s) 0 ratings
Top