Home > DNS and BIND, linux > DNS – Pointer Record (PTR)

DNS – Pointer Record (PTR)

January 30th, 2011

Pointer Record (PTR)

Pointer records are the opposite of A and AAAA RRs and are used in Reverse Map zone files to map an IP address (IPv4 or IPv6) to a host name.
Format

name ttl  class   rr     name
15         IN     PTR    www.example.com.

The number ’15’ (the base IP address) in the above example is actually a name and because there is no ‘dot’ BIND adds the $ORIGIN. The example below which defines a reverse map zone file for the Class C address 192.168.23.0 should make this clearer:

$TTL 2d ; 172800 secs
$ORIGIN 23.168.192.IN-ADDR.ARPA.
@             IN      SOA   ns1.example.com. hostmaster.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
....
15            IN      PTR     www.example.com.
....
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.23.168.192.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.

source of information

Categories: DNS and BIND, linux Tags:
Comments are closed.