Guides

What Is a PTR Record? Reverse DNS Explained With Examples

A PTR record is DNS in reverse: it turns an IP address into a hostname. Here is how it works, why mail servers live or die by it, and how to check and set one up.

Cysoro Security TeamPublished · 9 min read
203.0.113.10 IP address in mail.example.com hostname out — PTR record 10.113.0.203.in-addr.arpa GUIDES What is a PTR record? Reverse DNS, explained.
Quick answer

A PTR record, or pointer record, maps an IP address to a hostname — the reverse of an A record, which maps a hostname to an IP address. It lives in a reverse DNS zone (in-addr.arpa for IPv4, ip6.arpa for IPv6) controlled by whoever owns the IP address block. Mail servers check it to confirm a sending server is who it claims to be, and Gmail requires valid forward and reverse DNS from every sender.

Key takeaways

  • A PTR record maps an IP address to a hostname; it is the reverse of an A record and lives in the in-addr.arpa or ip6.arpa zone.
  • You do not set a PTR in your own domain's DNS: whoever owns the IP address block controls it, usually your ISP or cloud provider.
  • Gmail requires forward-confirmed reverse DNS from all senders — the PTR name must resolve back to the same IP, or mail can be rejected.

Every DNS lookup you make runs in one direction: a name goes in, an IP address comes out. A PTR record runs the other way. Give it an IP address and it hands back a hostname — and that simple reversal is what lets mail servers prove they are who they claim to be.

What is a PTR record?

A PTR record, short for pointer record, is a DNS record that maps an IP address to a hostname. It is DNS type 12, defined in section 3.3.12 of RFC 1035, and its data is a single fully qualified domain name.

Where an A record says mail.example.com lives at 203.0.113.10, a PTR record says 203.0.113.10 is mail.example.com. The two records are mirrors of each other, but they live in different places: the A record sits in your domain's DNS zone, while the PTR record sits in a special reverse zone owned by whoever holds the IP address block.

That ownership split is the fact that causes most confusion about PTR records. You cannot set a PTR record in your own domain's DNS, because you do not own the reverse zone for your IP address — your ISP or cloud provider does.

How does a PTR record work?

A reverse lookup works by turning the IP address into a DNS name and querying that name. For IPv4, the four octets are written in reverse order and in-addr.arpa is appended, following the rule in section 3.5 of RFC 1035.

To look up 8.8.8.8, a resolver queries 8.8.8.8.in-addr.arpa and gets back dns.google. To look up 203.0.113.10, it queries 10.113.0.203.in-addr.arpa. The reversal exists so the reverse tree can be delegated the same way addresses are allocated: whoever holds 203.0.113.0/24 controls the zone 113.0.203.in-addr.arpa and publishes PTR records for its 256 addresses.

IPv6 works the same way under ip6.arpa, except all 32 hexadecimal digits of the address are reversed one by one, as defined in RFC 3596. The address 2001:4860:4860::8888 becomes a 32-label name ending in ip6.arpa. One IP address can carry more than one PTR record, although mail servers expect exactly one.

Forward DNS vs. reverse DNS FORWARD LOOKUP mail.example.com A record → 203.0.113.10 REVERSE LOOKUP 203.0.113.10 PTR record → mail.example.com LIVES IN YOUR ZONE you control it at your DNS host LIVES IN THE IP OWNER'S ZONE your ISP or cloud provider controls it
A and PTR records are mirrors — but they live in different zones, owned by different parties. Illustration by Cysoro.

What is forward-confirmed reverse DNS (FCrDNS)?

Forward-confirmed reverse DNS, or FCrDNS, is the two-step check receivers actually run. First they look up the PTR record for the connecting IP and get a hostname. Then they look up that hostname's A or AAAA record and check it points back to the same IP.

If both steps agree, the reverse DNS is valid. If the PTR points at a name whose A record points somewhere else, the check fails. The reason for the round trip is trust: whoever controls a reverse zone can point a PTR at any name they like, even one they do not own, so a PTR alone proves very little. The forward check is what makes the claim verifiable.

RFC 1912 recommends the same discipline for every host: for every IP address there should be a matching PTR record, and the PTR and A records should agree. Mail receivers turned that recommendation into a hard requirement.

PTR record vs A record: what's the difference?

PTR and A records answer opposite questions, and confusing them is the most common DNS mistake after mixing up A and CNAME records. Here is how the main record types compare.

RecordQuestion it answersWhere it livesWho controls it
AWhat IP is this hostname?Your domain's zoneYou, at your DNS host
AAAAWhat IPv6 address is this hostname?Your domain's zoneYou, at your DNS host
PTRWhat hostname is this IP?Reverse zone (in-addr.arpa / ip6.arpa)Whoever owns the IP block
CNAMEWhat is this hostname an alias of?Your domain's zoneYou, at your DNS host
MXWhich server handles mail for this domain?Your domain's zoneYou, at your DNS host

Notice the pattern: every record except PTR lives in your zone and is yours to change. PTR is the one record type most operators do not control in their own zone, which is why setting one up means a provider control panel, a support ticket, or a delegation of the reverse zone for larger address blocks.

Why do PTR records matter for email?

PTR records matter because receiving mail servers use them to decide whether to trust the server connecting to them. A server that cannot identify itself with a matching PTR and forward record looks like a spam source, and large mailbox providers treat it as one.

Google's email sender guidelines require valid forward and reverse DNS from all senders, not only bulk senders: the sending IP must have a PTR record that resolves to a hostname, and that hostname must have an A or AAAA record pointing back to the same IP. When Gmail refuses mail for this reason, its error reference uses 550 5.7.25. Yahoo's sender best practices list the same requirement, and Outlook.com asks for valid reverse DNS for mail servers.

A PTR record is not part of SPF, DKIM or DMARC. A correct PTR does not make DMARC pass, and a missing one does not make it fail — but mail can still be rejected or sent to spam before authentication is even checked.

Our guide to what DMARC is covers the authentication side of the story. The PTR is the identity check that runs before authentication is even checked.

The signing step that works alongside it is DKIM, explained in our guide to what DKIM is.

How do you check a PTR record?

Checking a PTR record takes one command, and you should check the address your mail actually leaves from — not your website's IP, which is usually a different address entirely.

  • Mac or Linux: dig -x 203.0.113.10 +short returns the PTR hostname. Add the authoritative nameserver to skip cached answers: dig -x 203.0.113.10 @ns1.provider.example +norecurse.
  • Windows: nslookup 203.0.113.10 shows the PTR record and the server that answered.
  • PowerShell: Resolve-DnsName -Name 10.113.0.203.in-addr.arpa -Type PTR queries the reversed name directly.
  • Online: paste the IP into our free DNS lookup tool and select PTR, or use Google Admin Toolbox Dig.

Try it on a famous address: dig -x 8.8.8.8 returns dns.google., and looking up dns.google returns 8.8.8.8 — a perfect forward-confirmed round trip. Then check the reverse of your own mail server the same way, and confirm the name it returns resolves back to the same IP.

To find which IP your mail leaves from, send a message to a Gmail address, open Show original, and read the first Received line Google added. The bracketed address in that line is the one that needs a PTR record.

FCrDNS check, worked example $ dig -x 203.0.113.10 +short mail.example.com. $ dig mail.example.com +short 203.0.113.10 Round trip matches — FCrDNS passes PTR name and A record agree on the same IP address. If the second lookup returns a different IP, the check fails.
Forward-confirmed reverse DNS in two commands. Illustration by Cysoro.

How do you set up a PTR record?

Setting up a PTR record starts with finding who controls it. The PTR is set by whoever owns the sending IP, so the first step is to identify that owner — usually your hosting provider, cloud provider or ISP.

  1. Pick one hostname for the mail server, typically mail.example.com or smtp.example.com. Use the same name your server announces in its HELO/EHLO greeting.
  2. Create the forward A record first. Add mail.example.com pointing at the sending IP in your own DNS zone. Several providers refuse to set a PTR until the name already resolves to that IP.
  3. Set the PTR where the IP lives. In AWS, set the reverse DNS on the Elastic IP; in Azure, set the reverse FQDN on the public IP resource; in Google Cloud, set it on the VM's external IP access config. Smaller hosts usually offer a reverse DNS field in their control panel or set it on request.
  4. Verify the round trip with dig -x and a forward lookup, as shown above.
  5. Send a test message to a Gmail address and confirm it lands in the inbox, then check the headers to confirm the PTR Google saw.

If you send through Google Workspace, Microsoft 365 or an email service provider such as Amazon SES, SendGrid or Mailgun, the mail leaves from their IPs and they handle reverse DNS. There is nothing for you to set — and a PTR for your website's IP will not change anything. If those messages go to spam, the cause is somewhere else, usually SPF, DKIM or DMARC. You can check your domain's authentication with the free DMARC checker.

Common PTR record mistakes

Most PTR problems come from a small set of errors, and all of them are easy to avoid once you know the pattern.

  • Setting the PTR in your own DNS zone. It will never be read there. PTR records only work in the reverse zone owned by the IP holder.
  • Pointing the PTR at a name with no forward record. The round trip fails, and receivers reject the mail.
  • Using a generic ISP hostname. A PTR such as 203-0-113-10.isp.example.net technically resolves, but it signals an unmanaged server. Use a hostname in a domain you control.
  • Multiple PTR records on one IP. Allowed by the RFCs, but mail receivers expect one, and different receivers may pick different answers. Use one PTR per sending IP.
  • Forgetting IPv6. Each IPv6 sending address needs its own PTR record under ip6.arpa and its own AAAA record. The IPv4 setup does not cover it.
  • Setting the PTR before the A record. Create the forward record first, or the provider may refuse the PTR request.

Another common mistake is assuming a PTR record fixes deliverability on its own. It is one check among many: authentication, IP reputation, content and engagement all matter too. If mail is still landing in spam after the PTR is fixed, check your MX records and authentication next.

Do you need a PTR record if you use Google Workspace or Microsoft 365?

No. Your mail leaves from the provider's servers, and the provider manages their reverse DNS. Microsoft documents that its outbound IPs already have forward-confirmed reverse DNS, and Google sets a valid PTR on its outbound IPs. You still need SPF, DKIM and DMARC on your own domain — those live in your zone and are your responsibility.

The only people who need to set a PTR are those who send mail from an IP they are responsible for: a VPS or cloud instance running Postfix or Exim, an on-premises Exchange server, an appliance, or a dedicated IP at a hosting company. If you are not sure which group you are in, check the Received headers of a message you sent, as described above.

The bottom line

A PTR record is a small piece of DNS with an outsized job: it is how a mail server proves its IP address belongs to a named, reachable host. Gmail and Yahoo require it from every sender, and without the forward-confirmed round trip your mail can be rejected before anyone reads it.

Remember the two rules that prevent nearly every PTR problem: the record is set by whoever owns the IP, not by you in your domain's DNS, and the PTR name must resolve back to the same IP. Check yours with dig -x, fix the round trip, and verify it in our free DNS lookup tool.

Frequently asked questions

What is a PTR record in simple terms?

A PTR record answers the question: which hostname belongs to this IP address? It is the reverse of an A record. You give it an IP address such as 8.8.8.8 and it returns a hostname such as dns.google.

What is the difference between a PTR record and an A record?

An A record maps a hostname to an IP address (mail.example.com points to 203.0.113.10), while a PTR record maps an IP address back to a hostname (203.0.113.10 points to mail.example.com). The A record lives in your domain's DNS zone; the PTR record lives in the reverse zone owned by whoever holds the IP block.

Do I need a PTR record for my website?

No. A PTR record matters for mail servers, not websites. Visitors reach your website through its A or AAAA record, and no browser checks reverse DNS. Only set a PTR for an IP address that sends email.

How do I check my PTR record?

On Mac or Linux, run dig -x followed by the IP address, for example dig -x 8.8.8.8. On Windows, run nslookup followed by the IP. You can also use an online DNS lookup tool. If the answer is a generic ISP hostname, that is normal for a home connection.

Why does Gmail reject mail without a PTR record?

Gmail requires every sender to have valid forward and reverse DNS. A missing or mismatched PTR record looks like a server that nobody bothered to identify, which is typical of spam sources. Gmail rejects such mail with a 550 5.7.25 error.

Can I set a PTR record at my domain registrar?

No. PTR records live in the reverse DNS zone for the IP address block, which belongs to whoever was allocated the addresses — usually your ISP or cloud provider. Your domain registrar or DNS host cannot publish a PTR for an IP it does not own.

Does a PTR record have to match my domain name?

No. The PTR name only has to resolve back to the same IP address — that is forward-confirmed reverse DNS. A PTR pointing at mail.yourprovider.com while you send as [email protected] is normal. What matters is the round trip, not the domain.

How long does a PTR record take to work?

Usually minutes to a few hours after your provider sets it, but cached old answers can linger until their TTL expires. Check with dig -x against the authoritative nameserver to see the new value immediately, rather than waiting on cached resolvers.

Sources

  1. RFC 1035 — Domain Names: Implementation and Specification
  2. RFC 1912 — Common DNS Operational and Configuration Errors
  3. Google — Email sender guidelines
  4. DNSimple — PTR Record Reference
  5. RFC 3596 — DNS Extensions to Support IP Version 6
Written & fact-checked byCysoro Security Team

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.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against RFC 1035 (section 3.3.12), RFC 1912 and Google's email sender guidelines.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free