Setting Up Reverse DNS — PTR Record

What is the reverse DNS?

Reverse DNS is an IP address to domain name mapping – the opposite of Forward DNS which maps domain names to IP addresses.



# host has address


# host domain name pointer

What does the Reverse DNS serve for?

The Reverse DNS is one of the basic requirements for running some Internet protocols. It is also often used as a spam filter to determine whether the IP address of the incoming message matches an authenticated domain name and to block the message if it doesn’t.

Who controls the reverse DNS?

Reverse DNS is controlled by the owner of the IP address (probably your SIP).

How to check the reverse DNS?

Using one of the following commands, you can get the reverse DNS.

Using the ‘host’ command:

# host domain name pointer

Using the ‘nslookup’ command:

# nslookup     name =

Using the ‘dig’ command:

# dig -x 859 IN     PTR

Configuring the reverse DNS

Lets setup PTR record for the IP address ‘’. It should be pointed to ‘’.

Add the new zone to the ‘named.conf’ file as follows:

zone "" {
type master;
file "/var/named/";

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

           IN  NS
           IN  NS

; ----------- ENREGISTREMENTS -----------
5                      IN PTR        
; ----------- ENREGISTREMENTS SPECIAUX -----------

Where ‘’ and ‘’ are your DNS servers.

Save the changes and reconfig ‘named’:

# rndc reconfig

Check the PTR:

# dig -x +short

3 Replies to “Setting Up Reverse DNS — PTR Record”

  1. $TTL 1D
    @ IN SOA (
    0 ; serial
    1D ; refresh
    1H ; retry
    1W ; expire
    3H ) ; minimum

    131 PTR

    ****************************** I have tried this configuration…. But, I can’t understood that where I am wrong.

  2. В файле named.conf:
    file “/var/named/”

    не хватает ‘;’

    1. Спасибо.

Leave a Reply