A reverse DNSDNS The internet’s phone book. It turns a name people can remember, like example.com, into the number address computers use to find the server. More about DNS → lookup starts with an IP address and asks which host name belongs to it, the opposite of a normal lookup. This guide is for anyone running a server, sending email from one, or reading logs full of IP addresses who wants to know what reverse DNS is, how to check it and how to set it properly.
A reverse DNS lookup asks DNS for the PTR record of an IP addressIP address The number address of a device on the internet, like 203.0.113.10. Computers use it to find each other, the way post uses street addresses. More about IP address → and returns a host name, such as 203.0.113.10 pointing to mail.example.com. Run it with dig -x 203.0.113.10, nslookup 203.0.113.10 or Resolve-DnsName 203.0.113.10. You cannot set a PTR record in your domain’s DNS zone: it is set by whoever owns the IP address, usually your host or internet provider, often through a “reverse DNS” field in their control panelControl panel A website you log into to manage your hosting with buttons and forms, instead of typing commands. cPanel and Plesk are the common ones. More about Control panel →.
What reverse DNS is and how it works
Normal (forward) DNS turns a name into an address. You ask for the A record of example.com and get back 203.0.113.10. How DNS works walks through that chain step by step.
Reverse DNS goes the other way. It uses a separate record type, the PTR record (short for pointer), which maps an IP address back to a host name. An IP address can have a PTR record whether or not any website lives on it.
The in-addr.arpa trick
DNS can only look up names, not numbers, so reverse lookups turn the address into a special name. For IPv4, the four parts of the address are written backwards and .in-addr.arpa is added on the end:
203.0.113.10 becomes 10.113.0.203.in-addr.arpa
The order is reversed because DNS names get more specific from right to left (com, then example.com, then www.example.com), while IP addresses get more specific from left to right. Flipping the address lets the owner of the whole 203.0.0.0 range hand the 203.0.113.x part to whoever runs that smaller block, in the same way a domain hands out subdomainsSubdomain A name in front of your domain, like shop.example.com or blog.example.com. It can show a different site from the main one. More about Subdomain →.
IPv6 works the same way under ip6.arpa, but every hexadecimal digit (each “nibble”) becomes its own label. The address 2001:db8::1 turns into a long name of 32 single digits ending in 8.b.d.0.1.0.0.2.ip6.arpa. You rarely need to type this yourself, because the tools below build it for you.
Who controls the PTR record
This is the part that catches most people out. The reverse zone for an address belongs to the organisation that was allocated the address block, not to whoever owns the domain name in the answer.
| You want to set | Who controls it | Where you change it |
|---|---|---|
| A record for example.com | You, as the domain owner | Your DNS host or registrar |
| PTR record for 203.0.113.10 | The owner of the IP block | Your server host or internet provider |
So adding a PTR record in cPanelcPanel The most popular hosting control panel: a website where you manage your email, files, databases and domains with point-and-click tools instead of commands. More about cPanel →’s Zone Editor or at your registrar does nothing for reverse lookups. Nobody on the internet will ever ask your domain’s nameservers for 10.113.0.203.in-addr.arpa.
How to do a reverse DNS lookup
Every common operating system can do a reverse lookup with tools that are already installed. The examples use 203.0.113.10, a documentation address, so the output shown is what you would see on a server whose PTR record is set to mail.example.com.
dig on macOS and Linux
The -x option tells dig to build the in-addr.arpa name for you and ask for the PTR record:
dig -x 203.0.113.10
Look at the ANSWER SECTION:
;; ANSWER SECTION:
10.113.0.203.in-addr.arpa. 3600 IN PTR mail.example.com.
The number 3600 is the record’s TTL in seconds. For just the name, add +short:
dig -x 203.0.113.10 +short
If the status line says NXDOMAIN and there is no answer section, the address has no PTR record at all. On Ubuntu and Debian, dig comes in the dnsutils package (bind9-dnsutils on newer releases); on AlmaLinux and Rocky it is in bind-utils.
host on Linux and macOS
The shorter host command does a reverse lookup automatically when you give it an IP address:
host 203.0.113.10
It answers with one line, such as 10.113.0.203.in-addr.arpa domain name pointer mail.example.com.
nslookup on Windows, macOS and Linux
nslookup 203.0.113.10
The line starting name = is the PTR answer. A message such as can't find 203.0.113.10: Non-existent domain means there is no PTR record.
PowerShell on Windows
Resolve-DnsName 203.0.113.10
PowerShell sees that the input is an IP address and asks for the PTR record. The host name appears in the NameHost column.
Checking IPv6
All the same commands accept IPv6 addresses:
dig -x 2001:db8::1 +short
For more on the tools themselves, including choosing which DNS server answers, see how to do a DNS lookup.
Forward-confirmed reverse DNS
A PTR record on its own proves very little, because whoever controls an IP block can point it at any name they like, including yours. Receiving systems therefore do a second check, called forward-confirmed reverse DNS (FCrDNS):
- Look up the PTR record of the connecting IP address. Suppose it returns mail.example.com.
- Look up the A (or AAAA) record of mail.example.com.
- Check that the address from step 2 is the same IP address you started with.
If both directions agree, the name is trustworthy, because the IP owner and the domain owner have both vouched for it. You can run the same check yourself:
dig -x 203.0.113.10 +short
dig mail.example.com A +short
The first command should print mail.example.com. and the second should print 203.0.113.10. If either is missing or they disagree, fix that before anything else.
Why reverse DNS matters for email
Most people meet reverse DNS when their server’s mail starts bouncing or landing in spam. Large mailbox providers check the PTR record of every server that connects to deliver mail. Google’s sender guidelines, for example, ask every sender, not just bulk senders, to have valid forward and reverse DNS for their sending IP addresses.
A good setup for a server that sends mail looks like this:
- The sending IP has exactly one PTR record.
- That PTR names a real host, such as mail.example.com, not a generic name like
203-0-113-10.static.provider.example. - The host name has an A recordA record The line in a domain’s settings that says which server’s address to send visitors to. Like a forwarding address card for your website. More about A record → pointing back to the same IP (FCrDNS passes).
- The mail server introduces itself with the same name in its SMTP greeting (the HELO or EHLO name).
On a Postfix server, the greeting name comes from the myhostname setting. Check it with:
postconf myhostname
If it does not match the PTR name, set it in /etc/postfix/main.cf and reload Postfix:
myhostname = mail.example.com
sudo systemctl reload postfix
Reverse DNS is only one part of being trusted. You still need SPF, DKIM and DMARC on your domain. If mail still goes to spam with all of these in place, work through why emails go to spam.
If your site’s email is sent through your host’s shared mail servers or an outside email service, you do not need to set any PTR record: the operator of those servers handles it.
Other places reverse DNS shows up
Reverse DNS is not only for email. You will see it in several other places:
- Server logs and tools. Programs such as
traceroute,ssand some log viewers show host names instead of bare IP addresses by doing reverse lookups. This is why traceroute can be slow: each hop waits for a PTR answer.traceroute -nskips them. - SSHSSH A secure way to type commands on a server from your own computer, as if you were sitting at it. More about SSH → logins. The SSH server can look up the name of each connecting client. In current OpenSSH this is off by default (
UseDNS noin/etc/ssh/sshd_config), because slow reverse lookups made logins hang for many seconds. - Network troubleshooting. A PTR record often hints at who runs an address and roughly where it is, which helps when you are reading firewallFirewall A gatekeeper that decides which connections are allowed into a server and blocks the rest. More about Firewall → logs or a traceroute.
- Your own servers. Giving each server a sensible PTR, such as web1.example.com, makes logs and monitoring easier to read.
Reverse DNS is different from what many online tools call a “reverse IP lookup”, which tries to list every website hosted on one address. That kind of tool guesses from data it has collected; it does not use PTR records.
How to set up reverse DNS for your server
1. Find who owns the IP address
If you rent a VPSVPS A private slice of a powerful server, with its own guaranteed share of memory and processing and full control, at a fraction of the price of a whole machine. More about VPS → or dedicated server, the hosting company owns the address. If you have a fixed IP from a business broadband line, the internet provider owns it. You can confirm the owner with a WHOIS lookup on the IP address.
2. Create the forward record first
In your domain’s DNS, add an A record (and AAAA for IPv6) for the host name you want, for example mail.example.com pointing to 203.0.113.10. Many hosts refuse to set a PTR record until the forward record already resolves, because otherwise FCrDNS would fail. If cPanel runs your DNS, edit the record in the Zone Editor.
3. Set the PTR record with the IP owner
Look in your host’s control panel for a field called reverse DNS, rDNS or PTR, usually on the page for the server or its network settings. Enter the full host name. If there is no such field, open a support ticket asking them to set the PTR for 203.0.113.10 to mail.example.com. Home and consumer broadband connections usually cannot have a custom PTR at all, which is one reason mail sent straight from them is so often refused.
4. Wait, then check
The old PTR answer may stay in caches for its TTLTTL How long other computers may remember a domain setting before checking again, in seconds. Short means changes show up faster. More about TTL →. Check from outside your own network with a public resolver:
dig @1.1.1.1 -x 203.0.113.10 +short
When it shows your host name and the forward lookup returns the same IP, you are done.
If you run your own IP block and need to delegate reverse DNS for a range smaller than a /24 (fewer than 256 addresses), the standard method uses CNAME recordsCNAME record A domain setting that says “this name is just another name for that one”. For example, www pointing at the main domain. More about CNAME record → in the parent zone, described in RFC 2317. Your upstream provider has to set this up with you.
Common problems
| Symptom | Cause | Fix |
|---|---|---|
| dig -x returns NXDOMAIN | No PTR record exists for the address | Ask the IP owner to create one |
| PTR shows a generic provider name | The default PTR was never changed | Set a custom PTR in the host’s panel or by ticket |
| PTR added in your zone has no effect | Reverse zones belong to the IP owner, not the domain owner | Remove it and set the PTR with your host |
| Host will not accept the PTR name | The forward A record is missing or wrong | Add the A record, wait for it to resolve, try again |
| Mail rejected mentioning reverse DNS or PTR | Missing PTR, or PTR and A record disagree | Fix both directions so FCrDNS passes |
| New PTR not visible yet | The old answer is cached | Wait for the old TTL to expire, then check with a public resolver |
| SSH login pauses before the password prompt | The server is reverse-resolving the client slowly | Make sure UseDNS no is set in sshd_config |
Official documentation
- RFC 1035: Domain names, implementation and specification (section 3.5 defines in-addr.arpa)
- RFC 3596: DNS extensions to support IP version 6 (defines ip6.arpa)
- Google: Email sender guidelines
Related
- What is an IP address?: IPv4, IPv6 and who hands out addresses.
- What is DNS propagation?: why a changed record, PTR included, takes time to reach everyone.
- How to flush your DNS cache: clear an old answer from your own computer after a change.
Something out of date? Software changes. If a step no longer works, tell us and we will check it and update the page.


