Reverse DNS lookup: how it works, how to run one and why email needs it

Diagram of a reverse DNS lookup from an IP address to a hostname

A reverse DNS lookup asks the Domain Name System which hostname belongs to an IP address. It is the opposite of the usual lookup, which turns a name into an address. The answer comes from a PTR record, published by whoever controls the IP address. Receiving mail servers run this check on servers that connect to them, so a missing or mismatched answer can get email deferred or rejected.

The lookup is also called rDNS or a reverse IP lookup. This page covers how the query is built, how to run it on any system, who can change the answer, and what the large mailbox providers publish about it.

What is reverse DNS, and how is it different from a normal lookup?

Reverse DNS is the part of the DNS that maps IP addresses back to names. A forward lookup starts with a name such as mail.example.com and returns an address. The reverse direction starts with the address and returns the name.

The two directions live in different places and are run by different people. Your domain's zone holds the forward records. The reverse records sit in a special zone that belongs to the owner of the address block, which is usually a hosting company or an internet provider.

Forward lookup Reverse lookup
Question Which address does this name have? Which name does this address have?
Record type A for IPv4, AAAA for IPv6 PTR
Where the record lives The zone of your domain in-addr.arpa for IPv4, ip6.arpa for IPv6
Who can edit it Whoever runs DNS for the domain Whoever controls the IP address block
Defined in RFC 1035 RFC 1035 and RFC 3596

Nothing forces the two directions to agree. RFC 1035, published in November 1987, warns that the reverse data and a host's normal data sit in different zones, so the two can be inconsistent. Most of the trouble with reverse DNS comes from that one design fact.

What is a PTR record?

A PTR record is a DNS record that points from an address to a name. PTR stands for pointer. RFC 1035 gives it record type 12 and describes its content as a domain name that points to some location in the domain name space.

A PTR record is plain data. The same RFC says these records do not trigger any special processing of the kind a CNAME does. A resolver that asks for one gets a name back and nothing else.

Here is one in zone file form, for the documentation address 203.0.113.10:

10.113.0.203.in-addr.arpa.  3600  IN  PTR  mail.example.com.

The left side is the address, written backward under in-addr.arpa. The right side is the hostname the address claims. The number 3600 is the time to live in seconds, so resolvers may cache this answer for 1 hour.

RFC 1912, an informational guide to common DNS errors from February 1996, adds two rules of practice. Every host reachable from the internet should have a name, and a PTR record must point to a name with a real A record, not to a CNAME alias.

How is the reverse name built for IPv4 and IPv6?

The reverse name is the IP address written backward, with a fixed suffix on the end. The order is reversed because DNS names get more specific from right to left, while IP addresses get more specific from left to right.

For IPv4, RFC 1035 uses the in-addr.arpa domain. Each of the 4 octets becomes one label, in reverse order. The RFC's own example is that data for address 10.2.0.52 is found at the name 52.0.2.10.in-addr.arpa.

For IPv6, RFC 3596 uses the ip6.arpa domain. The address is written out in full as 32 hexadecimal digits, called nibbles. The digits are reversed, starting with the lowest, and separated by dots.

Address Step Name that is queried
203.0.113.10 Reverse the 4 octets, add the suffix 10.113.0.203.in-addr.arpa
2001:db8::10 Expand to 2001:0db8:0000:0000:0000:0000:0000:0010 (32 digits, no change yet)
2001:db8::10 Reverse the 32 digits, add the suffix 0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa

You rarely type these names by hand, because the lookup tools build them for you. They matter when you read a zone file or a provider's control panel, where the reversed form is what you see.

Reversal also explains who can answer. The reversed order lets a whole network be handed to one operator as a zone. For blocks smaller than 256 addresses, RFC 2317 from March 1998 describes a way for the provider to hand control down with CNAME records.

How do you run a reverse DNS lookup?

One command runs the lookup on every common system: dig -x on macOS and Linux, and nslookup or Resolve-DnsName on Windows. Give the command the IP address, and it builds the reversed name for you.

On macOS or Linux:

$ dig -x 203.0.113.10 +short
mail.example.com.

$ host 203.0.113.10
10.113.0.203.in-addr.arpa domain name pointer mail.example.com.

On Windows, in a command prompt or in PowerShell:

> nslookup 203.0.113.10
Name:    mail.example.com
Address: 203.0.113.10

> Resolve-DnsName 203.0.113.10
Name                       Type  TTL   NameHost
10.113.0.203.in-addr.arpa  PTR   3600  mail.example.com

These outputs are illustrations with a documentation address and an example name, not captured results. Your own output will carry your address and whatever name the owner of the address has set.

Then run the second half, the forward lookup on the name you got back:

$ dig +short A mail.example.com
203.0.113.10

The check is complete only when the second answer is the address you started with. An empty answer to the first command means the address has no PTR record. A name that leads to a different address means the two directions disagree.

What is forward-confirmed reverse DNS?

Forward-confirmed reverse DNS means the lookup works in both directions and ends where it began. The address has a PTR record that names a host, and that host has an A or AAAA record that returns the same address. The short form is FCrDNS.

The second step is what makes the result worth anything. Anyone who controls an address block can write any name into a PTR record, including a name on a domain they do not own. Only the owner of the domain can publish the matching forward record.

RFC 8601, published in May 2019, gives this test a name for mail headers: iprev. The receiver looks up the PTR names of the connecting address, looks up the addresses of each name, and passes the test if the original address is among them.

iprev result Meaning in RFC 8601
pass The reverse and forward lookups agree
fail The lookups disagree, or the forward query returned nothing
temperror A lookup hit a transient error, and a later try may succeed
permerror No PTR data is published for the address

A receiver that records the test writes it into the Authentication-Results header. This is an illustration in the RFC's format, not a captured header:

Authentication-Results: mx.recipient.example;
    iprev=pass policy.iprev=203.0.113.10 (mail.example.com)

The RFC is frank about the limits. It notes "some contention" about the reliability of the test, and it says a receiving server often rejects the connection outright and records no result at all.

Why do mail servers check reverse DNS?

Mail servers check reverse DNS because it is a cheap, early test of whether a connecting machine is a managed mail server. The check needs only the IP address, so it can run before the receiver has seen any part of the message.

The reasoning is about accountability. A server with a matching name was set up by someone with control of both the address and a domain. An address with no name, or with a provider's default name, looks like a home connection or a compromised device.

The check is separate from the name a server announces in its greeting. RFC 5321, the SMTP standard, says a server may verify that the EHLO name matches the client's address, and that it "MUST NOT refuse to accept a message on that basis." Rejecting on a missing PTR record is a different policy, and receivers apply it freely.

Reverse DNS is also not SPF. SPF, defined in RFC 7208, checks the address against a list the domain owner publishes. SPF does have a ptr mechanism that leans on reverse lookups, and the RFC says not to use it. Our SPF checker shows whether your record still contains one.

A pass here proves little by itself. It shows that an address and a hostname agree. Authentication of the domain is the job of SPF, DKIM and DMARC, which we cover in SPF, DKIM and DMARC explained.

What do Google, Yahoo and Microsoft require?

All three publish a reverse DNS rule for sending servers, and Google and Yahoo apply it to every sender at any volume. As of December 4, 2026, this is what each provider's own page says.

Provider What the page says Applies to Source
Google Sending domains or IP addresses need valid forward and reverse DNS records. The sending address must match the address of the hostname named in the PTR record All senders, since February 1, 2024 Email sender guidelines
Yahoo A valid forward and reverse DNS record for sending IP addresses. It recommends "valid, meaningful, non-generic" PTR records that reflect your domain All senders Sender Best Practices
Microsoft (Outlook.com) "Email servers must have valid reverse DNS records." Connections from dynamic IP space may not be accepted Senders to Outlook.com Policies, Practices, and Guidelines

Google spells out both halves. Its guidelines say the public IP address of a sending server must have a PTR record that resolves to a hostname, and that the same hostname must have an A or AAAA record that resolves back to the sending address. That is forward-confirmed reverse DNS in all but name.

Yahoo adds a point about the name itself. As of December 4, 2026, its page tells senders not to use a reverse DNS name that looks like a dynamically assigned address in place of a static mail server.

Google also publishes the errors it returns when the check fails. As of December 4, 2026, its SMTP errors and codes reference lists four entries that mention PTR records:

Code Type What the entry says, shortened
421 4.7.0 Temporary The sending IP address has no PTR record, or the forward entry does not point back to it
451 4.7.23 Temporary The sending IP address has no PTR record, or the forward entry does not match it
550 5.7.1 Permanent The message does not meet IPv6 sending guidelines on PTR records and authentication
550 5.7.25 Permanent Sending IP addresses need a PTR record, with a forward entry that references the address

The texts in this table are shortened, so match on the code. Yahoo's error code page, as we read it on December 4, 2026, lists no code that names reverse DNS. Microsoft's policies page shows no date of last update.

Who controls the PTR record, and how do you set one?

The owner of the IP address controls the PTR record, not the owner of the domain. Adding a PTR record to your own domain's zone does nothing, because no resolver will ever look there.

Who that owner is depends on how you send:

How you send Who sets reverse DNS What you do
Google Workspace or Microsoft 365 mailboxes The provider. Mail leaves from its addresses Nothing
A shared pool at an email platform The platform Nothing. Confirm it once in a message header
A dedicated IP address at an email platform The platform, often with a name on your domain Ask whether a custom name is offered, and add the A record they give you
Your own server at a cloud or hosting company You, through the host's control panel or a support request Set the PTR record and the matching A record
A server on an office or home connection The internet provider Ask for a static address with a PTR record, or send through a relay

On your own server, the order matters. Set these 3 things so that they agree:

  1. Pick one hostname for the server, such as mail.example.com, on a domain you control.
  2. Publish the forward record in your domain's zone: an A record from that name to the server's address, and an AAAA record if it sends over IPv6.
  3. Set the PTR record at the owner of the address to the same name. Many hosts refuse to save it until step 2 resolves.

The pair looks like this:

mail.example.com.            3600  IN  A    203.0.113.10
10.113.0.203.in-addr.arpa.   3600  IN  PTR  mail.example.com.

Use the same name in the server's EHLO greeting. No rule on the provider pages cited here asks for that, but three names that agree are easier to audit than three that differ.

If the server sends over IPv6, repeat the work for that address. Google's guidelines note that an IPv6 authorization error can mean the PTR record for the sending server is not using IPv6. A server with reverse DNS on IPv4 only is one way to meet the 550 5.7.1 entry above.

Some connections cannot be fixed this way. The Spamhaus Policy Blocklist FAQ describes the PBL as a list of address space that should not send mail directly to the internet, such as ranges that providers assign to broadband customers. From such a range, the practical route is an SMTP relay, not a PTR request.

What do the common results mean?

Six results cover nearly every case: a clean match, no record, a generic name, a mismatch, several names at once, and a failed query. The first is the only one that needs no action on a server that sends mail.

What the lookup returns What it means What to do
A name on your domain, and the name returns the same address Forward-confirmed. The check passes Nothing
No answer, or NXDOMAIN No PTR record exists for the address Ask the owner of the address to set one
A name built from the address, on the host's own domain The provider's default record. Yahoo's page recommends non-generic names Replace it with a name on your domain
A name whose A record returns a different address, or none The two directions disagree. An iprev test reports fail Fix whichever record is stale, usually after a server move
Several PTR records for one address Each name has to pass the forward check, and each one is another record to keep in step Keep one PTR record per sending address
SERVFAIL or a timeout The reverse zone's name servers did not answer Report it to the owner of the address. It is their zone

The mismatch row is the one to expect after a migration. The server moves to a new address, the A record is updated, and the PTR record on the new address still holds the host's default name.

Changes are not instant. A resolver may keep the old answer until its time to live runs out, so retest after that period before you conclude the change failed.

How do we check reverse DNS on a sending domain?

We check reverse DNS from a delivered message, because the header shows the address that the receiver saw. A lookup on the address you believe you send from can test the wrong machine.

  1. We start with a real message sent from each system to a mailbox we control, and open the full headers.
  2. We find the address of the last hop in the top Received: line, the one written by the receiving server.
  3. We check that address in both directions with the commands above, and note the name, the forward answer and the time to live.
  4. We compare the name with the EHLO name in the same Received: line and with the sending domain.
  5. We repeat for IPv6 when any header shows a v6 address, since the two families have separate records.
  6. We ask who controls each address. On a platform's shared pool the answer is the platform, and the item is closed.

A large platform sets reverse DNS for its own addresses, so we look hardest at the edges: a web server that sends form mail, a self-hosted app, an office device that delivers directly.

Reverse DNS is one line on a longer list. A sender can pass it and still be filtered for complaints, weak authentication or poor list quality, which we cover in how to stop emails going to spam. To see how your domain's SPF, DKIM and DMARC records look today, run the free domain check.

What does a reverse lookup not tell you?

A matching PTR record tells a receiver that an address has an accountable name, and nothing about the mail itself. It does not authenticate your domain, and the provider pages cited here give it no reputation of its own.

Three limits are worth keeping in mind:

  • It says nothing about the From address. The name in the PTR record belongs to the server. DMARC, not reverse DNS, ties a message to the domain the reader sees.
  • It is not a list of every site on a server. A reverse IP lookup returns the names the address owner chose to publish, often just 1. Web tools that list all the sites hosted on an address use other data.
  • It is set per address. A pool of 8 sending addresses needs 8 PTR records and 8 matching forward records.

Passing the check removes one reason for a refusal. No provider page cited here says that it improves where a message lands, and placement still depends on authentication, complaints and sending history.

Drafted with AI assistance from our own records and client work, then reviewed and approved by Kunal Arora. See our editorial policy.