A reverse DNS lookup is a DNS query that finds the hostname associated with an IP address. It works by reversing the address and asking for the PTR (pointer) record stored under in-addr.arpa for IPv4 or ip6.arpa for IPv6. Mail servers use it to verify senders, and administrators use it to identify unknown connections in logs. The PTR record is controlled by whoever owns the IP block, usually the hosting provider or ISP.
Key takeaways
- Reverse DNS maps an IP address to a hostname using a PTR record — the exact opposite of an A record.
- PTR records live in special reverse zones (in-addr.arpa, ip6.arpa) controlled by the IP block owner, not the domain owner.
- A missing or mismatched PTR record is a common reason mail gets rejected or marked as spam.
Type a domain name into a browser and DNS turns it into an IP address. That is the direction everyone knows. Reverse DNS runs the other way: hand DNS an IP address, and it tells you which hostname claims it. Mail servers, security teams and network administrators all rely on that answer every day.
What is a reverse DNS lookup?
A reverse DNS lookup, often written rDNS, is the process of querying the Domain Name System to determine the hostname associated with a given IP address. It is the opposite of a standard forward lookup, which translates a hostname such as www.example.com into an IP address.
Reverse lookups are made possible by a specific DNS record type called the PTR, or pointer, record (type 12). The PTR record is the data entry that maps an IP address back to its corresponding hostname. DNSimple's reverse DNS guide explains the same mechanism in detail.
The most common reason anyone runs one is identification. A log full of IP addresses is hard to read; the same log with hostnames is immediately useful. A mail server that sees a new connection runs a reverse lookup to check whether the sender is who it claims to be.
How is reverse DNS different from forward DNS?
Forward and reverse DNS answer opposite questions, live in different zones, and are controlled by different people. That last difference is the one that causes most confusion.
| Forward DNS | Reverse DNS | |
|---|---|---|
| Question | What IP does this name point to? | What name does this IP point to? |
| Record | A or AAAA record | PTR record (type 12) |
| Example | mail.example.com → 192.0.2.10 | 192.0.2.10 → mail.example.com |
| Lives in | Your domain's DNS zone | Reverse zone: in-addr.arpa / ip6.arpa |
| Controlled by | You, via your DNS provider | Whoever owns the IP block |
The two records are stored in completely different places and maintained independently, which is why they can disagree. A forward lookup and a reverse lookup for the same host can return different answers — or one can exist without the other. That mismatch is itself a useful signal, as the email section below explains.
You can try both directions yourself with our free DNS lookup tool.
Check your own address first with the what is my IP tool, then look up its PTR record.
How does a reverse DNS lookup work?
DNS is fundamentally a system for looking things up by name, so a reverse lookup needs a trick: the IP address is turned into a specially formatted name, and then DNS is asked for the PTR record at that name. The trick is defined in RFC 1035, published in November 1987.
For IPv4, the four octets of the address are written in reverse order, and .in-addr.arpa is appended. The address 192.0.2.10 becomes the name 10.2.0.192.in-addr.arpa. The reversal lines the two hierarchies up: DNS names grow more specific from right to left, while addresses grow more specific from left to right.
For IPv6, each hexadecimal digit becomes its own label, reversed, with .ip6.arpa appended. The address 2001:db8::1 becomes a 32-label name ending in .ip6.arpa. The resolver then asks for the PTR record at that constructed name, and the authoritative server for the reverse zone answers with the hostname.
A PTR record in a zone file looks like this:
10.2.0.192.in-addr.arpa. IN PTR mail.example.com.
That single line is the whole answer. The record's data, called PTRDNAME in RFC 1035, is one domain name — the hostname that claims the address.
How do I run a reverse DNS lookup?
The quickest way is the command line. On macOS and Linux, run dig -x 192.0.2.10 and look for the PTR record in the answer section. On Windows, run nslookup 192.0.2.10. The host command works the same way: host 192.0.2.10.
Online tools do the same query without a terminal. Our DNS lookup tool can check PTR records.
The MX lookup tool covers the mail records that sit alongside them. When you run a lookup, check three things: whether a PTR record exists at all, what hostname it returns, and whether that hostname resolves back to the same IP.
That third check is the important one. A PTR record that points to a hostname whose A record points somewhere else is a mismatch, and mail servers treat mismatches as suspicious. The pair — PTR one way, A or AAAA record back — is called forward-confirmed reverse DNS, or FCrDNS.
Who controls PTR records?
Unlike forward DNS records, which you manage through your DNS provider, control over reverse DNS zones follows the IP address block. The organization that owns or is allocated the block runs the reverse zone for it.
In practice, that means your PTR records are managed by your internet service provider if you have static IPs from them, your cloud provider if you run on AWS, Google Cloud or Azure, or your hosting company if you have a dedicated server or VPS. Organizations allocated blocks directly by a Regional Internet Registry manage their own reverse zones.
This is the most common source of confusion. Adding a PTR record to your own domain's forward zone has no effect on reverse lookups, because resolvers query the name under in-addr.arpa or ip6.arpa — a zone your DNS provider does not control.
If you need a PTR record changed, ask the provider that owns the IP address. Most cloud providers expose the setting in their console; for example, you set a PTR record for an AWS Elastic IP or a Google Cloud external IP in the cloud console, not in your domain's DNS.
Why does reverse DNS matter for email?
Email is the most important use of reverse DNS. When a mail server receives a connection, it runs a reverse lookup on the connecting IP. If the IP has no PTR record, or the PTR record does not match the forward record, the message may be flagged as spam, quarantined or rejected outright.
Google's sender guidelines make this a hard requirement. Since February 1, 2024, all senders to Gmail accounts must have valid forward and reverse DNS records, and the sending IP must match the IP address of the hostname in the PTR record. Google's email sender guidelines list the full set of requirements.
Bulk senders — those sending 5,000 or more messages a day to Gmail — must also have SPF, DKIM and DMARC set up.
The setup is straightforward once you know who controls the record. Set the PTR record for your mail server's IP to the server's hostname, such as mail.example.com, and make sure that hostname has an A record pointing back to the same IP. That pair is the FCrDNS check described above.
Our guide to what DMARC is covers one of the other pieces of email authentication.
The guide to what DKIM is covers the other.
If your mail is being rejected with errors mentioning reverse DNS, check the PTR record first. It is the most common cause, and it is usually a five-minute fix with your hosting provider — once you know to ask them rather than your DNS provider.
How is reverse DNS used in security and troubleshooting?
Beyond email, reverse DNS shows up in three places: logs, incident response and network troubleshooting. Server logs record IP addresses; reverse lookups turn them into readable hostnames, which makes analysis and auditing far easier. A firewall log showing a connection from a hostname you recognize is a different story from one showing a bare address.
Security teams use reverse lookups to identify unknown connections, verify that a remote server is who it claims to be, and confirm that external services connect from expected hostnames. A connection from an address whose PTR record names a cloud provider's region is unremarkable; the same connection from an address with no PTR record at all deserves a closer look.
There is a limit, and it matters: a PTR record is a claim, not proof. The holder of an address block can write any hostname into a PTR record, so a reverse lookup alone never proves identity. Real verification needs the forward check as well, plus authentication — which is exactly why mail servers check both directions.
What goes wrong with reverse DNS?
Four problems account for most reverse DNS trouble. The first is a missing PTR record, which happens on new servers and cloud instances where nobody set one. The second is a generic PTR record: many providers set a default hostname such as a cloud-assigned name, which is valid but tells mail servers nothing about your domain.
The third is a mismatch, where the PTR record points to a hostname that resolves to a different IP. This usually happens after a server move, when the PTR record is updated in one place and the A record in another. The fourth is a stale record, where the IP has been reassigned to a new customer but the old PTR record still points at the previous owner's domain.
All four are fixed the same way: check the PTR record with dig -x, check the forward record, and ask the IP block owner to correct whichever side is wrong. For a fuller picture of the DNS records around a domain, see our DNS and domain security guide.
The bottom line
A reverse DNS lookup answers a simple question — which hostname claims this IP address — and the answer matters most where trust is decided automatically: mail delivery, log analysis and security monitoring. The record that answers it, the PTR record, lives in a reverse zone controlled by the IP block owner, not by you.
If you run a mail server, set the PTR record to the server's hostname and confirm the forward record points back. If you are investigating an unknown connection, run the lookup, check both directions, and remember that a PTR record is a claim, not proof. You can check any address in seconds with the free DNS lookup tool.
Frequently asked questions
What is a reverse DNS lookup?
A reverse DNS lookup is a DNS query that starts with an IP address and returns the hostname associated with it. It is the opposite of a normal forward lookup, which starts with a hostname and returns an IP address. The answer comes from a PTR record in a special reverse DNS zone.
What is a PTR record?
A PTR (pointer) record is a DNS record, type 12, that maps an IP address to a domain name. It is defined in RFC 1035. Its data is a single hostname, and it lives under in-addr.arpa for IPv4 addresses or ip6.arpa for IPv6 addresses.
How do I run a reverse DNS lookup?
On the command line, run dig -x followed by the IP address, or use nslookup or host with the IP address. You can also use an online DNS lookup tool. The result is the hostname from the PTR record, or no result if the address has no PTR record.
Why does my IP address have no PTR record?
Because PTR records are controlled by whoever owns the IP block — usually your hosting provider, cloud provider or ISP — not by your domain's DNS provider. If no PTR record exists, ask the IP block owner to set one. Adding a PTR record to your own domain's forward zone has no effect.
What is forward-confirmed reverse DNS?
Forward-confirmed reverse DNS, or FCrDNS, means the PTR record for an IP resolves to a hostname, and that hostname's A or AAAA record resolves back to the same IP. Mail servers check this pair: a PTR record that points to a name that does not point back is treated as suspicious.
Do I need a PTR record for my mail server?
Yes. Google requires all senders to Gmail to have valid forward and reverse DNS records, and the sending IP must match the hostname in the PTR record. Many other mail servers reject or mark as spam any mail from an IP with no PTR record. Set the PTR to your mail server's hostname, such as mail.example.com.
Can a reverse DNS lookup identify who owns an IP address?
Only loosely. A PTR record shows the hostname the IP block owner chose to publish, which is often informative — for example, an address that resolves to a Googlebot hostname is Google's crawler. But the owner can write any hostname into a PTR record, so the result is a claim, not proof of identity.
What is the difference between reverse DNS and WHOIS?
Reverse DNS returns the hostname associated with an IP address from its PTR record. WHOIS returns registration data about the IP block: the organization it is allocated to, the abuse contact and the allocation date. They answer different questions, and investigators usually check both.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against RFC 1035, the DNSimple reverse DNS and PTR record references, and Google's email sender guidelines.
How we write and fact-check →