PTR record lookup
Enter the IPv4 or IPv6 address you want to check. The default comes from a range reserved for examples and has no PTR record itself.
Only inserted into the commands in your browser.
dig · Linux, macOS
-x reverses the address for you and asks for the PTR record. You get the host name the IP's owner has published. An empty answer means there is no PTR record.
dig +short -x 192.0.2.25mail.example.com.nslookup · Windows, Linux, macOS
Given an IP address, nslookup asks for the PTR record by itself. On the left is the reversed address under in-addr.arpa, on the right the host name.
nslookup 192.0.2.25Non-authoritative answer:
25.2.0.192.in-addr.arpa name = mail.example.com.PowerShell · Windows
The NameHost column holds the host name. Without a PTR record Resolve-DnsName raises an error instead of returning nothing.
Resolve-DnsName -Name 192.0.2.25 -Type PTRhost · Linux, macOS
One sentence in reply; without a PTR record it reads "not found: 3(NXDOMAIN)".
host 192.0.2.2525.2.0.192.in-addr.arpa domain name pointer mail.example.com.Behind the scenes the address is reversed and queried in a zone of its own: 192.0.2.25 becomes 25.2.0.192.in-addr.arpa. For IPv6 every hex digit stands alone, backwards, under ip6.arpa. That is the typing -x saves you.
Forward confirmation: does the name point back?
A PTR record alone does not satisfy mail servers. They check that the name they found resolves to the same address again (forward-confirmed reverse DNS). For a domain's mail server that is three lookups: the MX, its address, and that address's PTR.
dig +short MX example.com
dig +short A mail.example.com
dig +short -x 192.0.2.25
# confirmation in one step: the output must be the IP again
dig +short A $(dig +short -x 192.0.2.25)If both directions agree and the mail server introduces itself with the same name when it connects, the requirement is met. Gmail and Microsoft expect this from every sender.
Find the public IP address of your server
Behind a router or in a cloud you often know only the internal address. A DNS trick reveals the public one: the OpenDNS resolver answers the name myip.opendns.com with the address the query came from.
# IPv4
dig +short -4 myip.opendns.com @resolver1.opendns.com
nslookup myip.opendns.com 208.67.222.222
# IPv6
dig +short -6 AAAA myip.opendns.com @resolver1.opendns.com
# PowerShell
Resolve-DnsName -Name myip.opendns.com -Server 208.67.222.222 -Type AMind the -4. On a connection with IPv6, dig reaches the resolver over IPv6 but asks for an A record, and the answer comes back empty; nslookup then says "No answer". With -4, or the resolver's IPv4 address (208.67.222.222), it works. For the IPv6 address ask for type AAAA.
What the answer means
Typical results and what to do:
- NXDOMAIN or an empty answer: there is no PTR record. Mail from this address is often rejected or lands in spam.
- The name looks like "ip-192-0-2-25.example.net": a provider default. Not good enough for a mail server; set the server's host name.
- You cannot find the PTR in your domain's DNS editor: it does not belong there. The PTR record is set by whoever owns the IP address, your hosting provider, usually in the customer portal under "reverse DNS" or "rDNS".
- The forward lookup returns a different IP: the name's A record points elsewhere, often after a server move.
- IPv4 has a PTR, IPv6 does not: if the server sends over IPv6, the missing record there is what counts. Add it or restrict sending to IPv4.
- Several names in the answer: permitted, but receivers treat it inconsistently. One PTR per address is the safe choice.
Checking without a terminal
The blacklist check finds the addresses of a domain's mail servers and website and queries them against the important DNS blocklists, which work on the same reversed-address principle. What to do when an address is listed is covered in the blacklist delisting guide.