Blog

What Is a PTR Record and How Does It Work?

DeBounce
Articles
17 min read

Key Takeaways

  • A PTR record performs reverse DNS lookup: it resolves an IP address to a hostname, rather than the other way around.
  • Mail servers check PTR records to verify the identity of incoming connections. A missing or mismatched PTR record is a common reason legitimate email gets flagged or rejected.
  • Unlike A records, PTR records are controlled by whoever owns the IP block (typically, your hosting provider or ISP).
  • Setting up a PTR record requires contacting your provider with the IP address and the hostname you want it to point to.
  • A correctly configured PTR record that matches your forward A record is one of the baseline requirements for healthy email deliverability.

DNS records are the infrastructure that keeps the internet functioning. Each record type handles a different job: some map domain names to IP addresses, some handle email routing, and some store verification data. Most people are familiar with A records and MX records, but there’s another type that plays a quiet and often overlooked role in email deliverability and network security: the PTR record.

If your emails have ever landed in spam even though everything seemed set up correctly, or you’ve come across something like “reverse DNS” in a rejection message, a PTR record is probably involved. Knowing what a PTR record is, how it works, and how to set it up properly can make a real difference in whether your emails reach the inbox.

What Is a PTR Record?

A PTR record, short for pointer record, is a type of DNS record that resolves an IP address to a fully qualified domain name (FQDN). Where an A record says “this domain name points to this IP address,” a PTR record says “this IP address belongs to this hostname.”

This process is called reverse DNS lookup, and it’s exactly what the name implies: instead of looking up a name to find an address, you’re looking up an address to find a name.

PTR records don’t live in the same DNS zone as your other records. They’re stored in a special reverse DNS zone that uses a specific format: for IPv4, the IP address is written in reverse order and appended with .in-addr.arpa. For IPv6, the equivalent is .ip6.arpa. This structure is what makes reverse DNS queries possible and distinguishable from standard forward lookups.

How a PTR Record Works

When a mail server or security system checks a PTR record, it is trying to see which hostname is linked to the sending IP address. Here’s what that process looks like step by step:

  1. A connection arrives from an IP address,  say, 192.0.2.45.
  2. The receiving system reverses the IP address, turning 192.0.2.45 into 45.2.0.192.
  3. It appends .in-addr.arpa, forming the DNS query 45.2.0.192.in-addr.arpa.
  4. DNS returns the PTR record, responding with the hostname associated with that IP, for example, mail.yourcompany.com.
  5. The receiving server compares the result, checking whether the hostname returned by the PTR record matches the domain the sender claims to be sending from.

If the PTR record exists and the hostname matches the forward A record for that domain, the check passes. If the PTR record is missing, or if it points to a hostname that does not match the rest of the mail setup, the server may treat the message as suspicious or reject it.

PTR Record Example

Here’s what a PTR record looks like in a DNS zone file:

45.2.0.192.in-addr.arpa.    3600    IN    PTR    mail.yourcompany.com.

Breaking that down in the table below:

PTR record table

The dot at the end of the hostname matters. It shows that the name is complete, not something that needs to be combined with a local domain. Most DNS tools add it for you, but it’s useful to know why it’s there.

For this PTR record to pass a reverse DNS check, mail.yourcompany.com must also have a forward A record pointing back to 192.0.2.45. That bidirectional match (PTR pointing to the hostname, A record pointing back to the IP) is what mail servers are looking for.

Why PTR Records Matter

PTR records play an important role in email delivery and network visibility. They help receiving systems verify who is sending a message, and they make technical logs easier to understand.

Email spam filtering and deliverability

When your mail server connects to another server, one of the first checks performed is a reverse DNS lookup on your IP address. The receiving server wants to see that your IP points to a valid hostname, and that this hostname makes sense alongside the domain you’re sending from.

A missing PTR record suggests the sending IP hasn’t been properly configured, which is common with compromised servers, spam infrastructure, and hijacked IP ranges. Many enterprise mail servers and spam filters will reject or heavily penalize email from IPs with no PTR record.

A mismatched PTR record, where the hostname returned doesn’t align with the sending domain, raises similar concerns. It may not block your email on its own, but it weakens trust and can affect your overall sender reputation.

Getting your PTR record right is a foundational step in the same category as setting up multiple SPF records correctly, setting up DMARC records, and ensuring a clean MX lookup. All of these help confirm that your domain is legitimate and that your email is coming from where it claims to.

Network logging and security diagnostics

Beyond email, PTR records are used by network administrators and security tools to make log files readable. Raw logs full of IP addresses are difficult to interpret quickly. When reverse DNS is configured correctly, tools like intrusion detection systems, firewalls, and server logs can display hostnames instead, making it easier to identify the source of a connection or investigate unusual activity.

Network troubleshooting tools like traceroute also rely on PTR records to display meaningful hop names instead of just raw IP addresses.

PTR Record vs. A Record

The link between PTR records and A records is simple, but the difference between them is important.

Ptr record vs a record

The part that usually surprises people is who controls each record. While you can update your A records anytime in your DNS settings, PTR records work differently. Since they are tied to the IP address, they’re managed by whoever owns that IP. In most cases, that means your hosting provider or cloud service, so you’ll need to request the change through them.

How to Set Up a PTR Record

Setting up a PTR record is not something you do through your domain registrar. You need to go through the organization that controls your IP address, which is typically your hosting provider, VPS provider, or ISP.

Here’s the general process:

How to set up a ptr record
  1. Identify the sending IP address, the one your mail server uses to send outbound email. This is usually found in your server or hosting control panel.
  2. Confirm your forward A record is in place: Before requesting a PTR record, make sure mail.yourdomain.com (or whichever hostname you plan to use) already has an A record pointing to that IP. The two records need to match.
  3. Contact your hosting provider: Most providers have a control panel option to set a PTR record, or a support request process. You’ll provide the IP address and the hostname you want it to resolve to.
  4. Wait for propagation: Like other DNS changes, PTR record updates can take anywhere from a few minutes to 48 hours to propagate fully.
  5. Verify the result: Once propagation is complete, test the reverse lookup to confirm it returns the expected hostname.

The hostname used in your PTR record should match the one your mail server sends in its HELO or EHLO greeting, which is part of the initial connection to the receiving server. Keeping these details consistent helps your setup pass checks from receiving servers and spam filters.

How to Look Up a PTR Record

Checking if a PTR record exists and seeing what it returns is simple. You can do it either from the command line or by using an online lookup tool.

Using nslookup:

nslookup 192.0.2.45

Or specify the query type explicitly:

nslookup -type=PTR 45.2.0.192.in-addr.arpa

Using dig (macOS/Linux):

dig -x 192.0.2.45

Both commands perform the reverse DNS lookup and return whatever PTR record is configured for that IP. A successful result looks something like this:

45.2.0.192.in-addr.arpa.  3600  IN  PTR  mail.yourcompany.com.

If no PTR record is found, you’ll see a response like NXDOMAIN (no such domain) or simply no answer section in the output. That’s the signal that a PTR record either hasn’t been configured or hasn’t propagated yet.

Online lookup tools work the same way: enter the IP address, and they’ll return the PTR record result without requiring command-line access. These are useful for quick checks, especially if you’re verifying a setup on behalf of a client or investigating a delivery issue.

The Bottom Line

A PTR record is a small but significant piece of DNS infrastructure. It performs reverse DNS lookup, resolving an IP address back to a hostname, and it’s one of the first things receiving mail servers check when a new connection arrives. Without a correctly configured PTR record, even well-crafted, legitimate email can be flagged, deferred, or rejected before it reaches the inbox.

The setup process is slightly different from other DNS records: you need to work through your hosting provider or ISP rather than your registrar. But once it’s in place and matched to your forward A record, it removes a common issue that can affect email delivery.

A correct PTR record signals that your sending IP is properly configured and trustworthy. From there, list quality becomes just as important. If you’re sending to invalid or risky addresses, even a well-configured setup won’t perform as expected.Tools like DeBounce help by checking DNS and MX records, identifying disposable or risky emails, and verifying mailbox availability through SMTP checks. Cleaning your list before sending helps ensure your emails are reaching real inboxes, not bouncing or disappearing.

Frequently Asked Questions

Answers to common questions about this topic.
01

What is the purpose of a PTR record?

A PTR record maps an IP address to a hostname through reverse DNS lookup. It’s primarily used by mail servers to verify that an email sender’s IP is legitimately associated with the domain they claim to be sending from.

02

What happens if a PTR record is missing?

Many receiving mail servers will flag, defer, or reject email from IPs with no PTR record, as missing reverse DNS is a common characteristic of spam infrastructure. It’s one of the more avoidable deliverability problems.

03

How long does a PTR record take to propagate?

PTR record changes typically propagate within a few minutes to a few hours, though full propagation across all DNS resolvers can take up to 48 hours in some cases.

04

What is the difference between a CNAME and a PTR record?

A CNAME record creates an alias from one hostname to another, both pointing forward (domain to domain). A PTR record performs reverse DNS resolution: mapping an IP address back to a hostname. They operate in opposite directions and serve entirely different purposes.

05

Is a PTR record necessary?

For anyone sending email from a dedicated server or IP address, it’s a requirement. Without one, your emails are far more likely to be rejected or filtered by receiving mail servers.