PTR record and reverse DNS
PTRA PTR record answers the reverse question: which hostname belongs to this IP address? Mail servers care about the answer.
Reverse DNS runs in its own tree
Forward DNS turns a name into an address. Reverse DNS turns an address into a name, using PTR records published under the special in-addr.arpa domain for IPv4 and ip6.arpa for IPv6.
The address is written backwards in that tree: 192.0.2.10 becomes 10.2.0.192.in-addr.arpa. Reversing the octets is what lets delegation follow the structure of the address space.
What a PTR record looks like
A PTR record maps a reversed address back to a name: 1.2.0.192.in-addr.arpa. 3600 IN PTR mail.example.com. That name is the address 192.0.2.1 with its octets written in reverse order and in-addr.arpa appended.
The reversal exists because DNS reads names from the most specific label leftward, while an IPv4 address gets more specific to the right. Turning it around lets a network hand out authority for its own block the same way a domain delegates a subdomain.
IPv6 uses ip6.arpa and reverses one hexadecimal digit at a time, which is why a reverse IPv6 name is long.
You usually cannot set it yourself
A PTR record lives in the zone for the IP address, not the zone for your domain. That zone belongs to whoever was allocated the address — your hosting provider or ISP.
This is why reverse DNS is normally configured in a provider control panel rather than in your own DNS. Adding a PTR record to your domain zone does nothing.
Checking reverse DNS
dig -x 192.0.2.1 does the reversal and the lookup in one step, returning the name published for the address if there is one.
A forward record and a reverse record are separate publications by separate parties, and nothing in DNS keeps them agreeing. Checking that the name a PTR returns resolves back to the same address is a distinct test, and mail servers frequently run it.
Why mail servers check it
Many receiving mail servers look up the PTR record of a connecting IP and check that it resolves forward to the same address. Mail from an address with no reverse DNS, or with reverse DNS that does not match, is treated with more suspicion.
This check is a convention among mail operators rather than a requirement of any email standard, but it is widespread enough that a sending server without correct reverse DNS will see delivery problems.
