What is a PTR record?
A PTR record maps an IP address to a host name. It is the opposite of an A or AAAA record, which is why looking one up is called a reverse DNS lookup, or rDNS.
The record is not stored in the zone of the host name. It lives in a separate tree: in-addr.arpa for IPv4 and ip6.arpa for IPv6, at a name made of the address written backwards. That tree belongs to whoever was assigned the address, usually a hosting provider or an internet provider.
Mail servers are the main users. Before accepting a message, most look up the PTR record of the sending address and then resolve the name they got. If that name points back to the same address, the reverse DNS is forward-confirmed. An address that fails this check has its mail rejected or sent to spam.
How to read a PTR record
In a zone file, the record looks like this:
8.8.8.8.in-addr.arpa. 86400 IN PTR dns.google.
- The reverse name: the address with its four numbers in reverse order, followed by in-addr.arpa. For IPv6 it is every hexadecimal digit in reverse order, followed by ip6.arpa.
- The TTL in seconds.
- The host name the address points to.
From the command line
Look up PTR records without this site.
On macOS and Linux, use dig:
dig -x 8.8.8.8 +short
On Windows, use nslookup:
nslookup 8.8.8.8
Both turn the address into its reverse name for you. The -x option of dig is short for dig 8.8.8.8.in-addr.arpa. PTR.
Questions and answers
How do I set or change the reverse DNS of my server?
Not at your domain's DNS host. The PTR record belongs to the owner of the IP address, so you set it in the control panel of your hosting provider, or ask its support. Internet providers set it on request for business connections with a fixed address.
What is forward-confirmed reverse DNS?
The address points to a name, and that name's A or AAAA record points back to the same address. Either half alone is not enough for mail servers. This tool checks both and tells you which names pass.
Why does an IP address have no PTR record?
Nobody is required to publish one. Many addresses of home connections and cloud servers have none, or a generic name made from the address. That matters only when the address sends e-mail.
Should the PTR record match my domain?
It should be a host name you control that points back to the address, such as mail.example.com, and the mail server should use the same name when it greets other servers. It does not have to equal the domain in your e-mail addresses.
Can one IP address have several PTR records?
Yes, but it rarely helps. Many receivers read only the first one, and long lists do not fit in a single DNS answer. One name per address is the usual advice.