Have you ever sent an email that mysteriously vanished into the digital void? Or wondered why your perfectly written message was in someone’s spam folder? Well, you might have a DNS PTR record to thank (or blame) for that.
DNS PTR records are the reverse phone book of the internet. Instead of looking up a name to find a number, PTR records let you look up an IP address to find a domain name. It’s like being able to punch in a phone number and figure out who it belongs to.
Why does this matter?
If you’re running a business, sending emails, or managing servers, PTR records can be the difference between your messages landing in an inbox or being tossed into the spam folder. They help with everything from network troubleshooting to cybersecurity.
Below, we’ll explain everything you need to know about DNS PTR records: what they are, how they work, and why they matter.
What are DNS PTR records?
PTR stands for “Pointer” record. It’s a type of DNS record that does the opposite of what you might be used to:
Normally, when you type a website name into your browser, DNS helps translate that into an IP address. It’s like looking up a friend’s name in your phone contacts to get their number. A PTR record flips this on its head—it starts with the IP address and gives you the domain name. It’s like entering a phone number into your contacts and finding out who it belongs to.
PTR records live in a special part of the DNS called the “reverse DNS” lookup zone. When someone wants to find out what domain name is associated with an IP address, they perform a reverse DNS lookup.
For example:
- Let’s say you’ve got the IP address 192.0.2.1
- To do a reverse DNS lookup, this gets flipped and turned into: 1.2.0.192.in-addr.arpa
- The DNS system then looks for a PTR record for this reversed address
- If it finds one, it returns the associated domain name
Forward DNS vs. reverse DNS: What’s the difference?
Think of forward DNS and reverse DNS as two sides of the same coin:
- Forward DNS: This is what you’re probably most familiar with. It takes a domain name (like www.example.com) and returns an IP address. It’s like looking up a business name to get their phone number.
- Reverse DNS: This is where PTR records come in. It takes an IP address and returns a domain name. It’s like having a phone number and wanting to know what business it belongs to.
You might think, “This is all very interesting, but why go through all this trouble?” Well, reverse DNS lookups serve several purposes:
- Email verification: Many email servers check PTR records to help verify the sender’s identity. No PTR record? Your email might end up in spam.
- Troubleshooting: Network admins use PTR records to identify which devices communicate on their networks.
- Improved user experience: Users can see readable domain names instead of seeing cryptic IP addresses in logs or connection information.
- Security: Some security systems use PTR records as part of their checks to identify potentially malicious traffic.
The anatomy of a PTR record
A PTR record is made up of two main parts:
- The IP address (in reverse)
- The domain name it points to
Here’s an example of a PTR record:
1.2.0.192.in-addr.arpa. IN PTR www.example.com.
Here’s what each part means:
- 1.2.0.192.in-addr.arpa.: This is our reversed IP address.
- IN: This stands for “Internet”. It’s just DNS-speak for “this record is for the internet.”
- PTR: This is the record type.
- www.example.com.: This is the domain name associated with the IP address. Notice the dot at the end? That’s actually important in your DNS—not a typo.
The reversed IP address and the “.in-addr.arpa” suffix are part of a system for managing reverse DNS lookups.
- The IP is reversed to create a unique domain name for each IP address.
- The “.in-addr.arpa” part is a special domain set aside for reverse DNS lookups.
When you see 1.2.0.192.in-addr.arpa, it’s really just a way of writing the IP address 192.0.2.1 in reverse DNS form.
However, if you’re dealing with IPv6 addresses (and increasingly, we all are), the PTR record looks a bit different:
1.0.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. IN PTR www.example.com.
Don’t panic, though—it’s just the IPv6 address written backwards, digit by digit, with “ip6.arpa” at the end instead of “in-addr.arpa”.
A few more things to note about PTR records:
- They’re usually created on the DNS servers of the organization that owns the IP address block (often your ISP or hosting provider).
- Unlike some DNS records, there should generally be only one PTR record per IP address.
- The domain in the PTR record should have a corresponding A (for IPv4) or AAAA (for IPv6) record pointing back to the IP address. This is called “Forward-Confirmed reverse DNS” (FCrDNS).
PTR records vs. other DNS record types
PTR records are just one element in the DNS ecosystem. To understand their role, you need to see how they stack up against their DNS cousins.
A Records
A records are the most common type of DNS record. They do the job of linking a domain name to an IPv4 address.
- What they do: Point a domain to an IP address
- Example: example.com IN A 192.0.2.1
- How they differ from PTR: A records go from domain to IP, while PTR goes from IP to domain.
AAAA Records
AAAA records are basically A records for IPv6.
- What they do: Point a domain to an IPv6 address
- Example: example.com IN AAAA 2001:db8::1
- How they differ from PTR: Like A records, they go from domain to IP (just a longer IP), while PTR does the reverse.
CNAME Records
CNAME records create aliases for other domain names.
- What they do: Point one domain name to another domain name
- Example: www IN CNAME example.com
- How they differ from PTR: CNAMEs link domains to domains, not IPs to domains like PTR records.
MX Records
MX records tell email where to go.
- What they do: Specify mail servers for a domain
- Example: example.com IN MX 10 mail.example.com
- How they differ from PTR: MX records direct email traffic, while PTR records are often used to verify email servers.
TXT Records
TXT records hold pretty much any text information.
- What they do: Store text information in DNS
- Example: example.com IN TXT “v=spf1 include:_spf.example.com ~all”
- How they differ from PTR: TXT records are super flexible, while PTR records have a specific job (reverse DNS).
Where does PTR fit in?
PTR records help with:
- Email verification: Many email servers check PTR records to help prevent spam.
- Network troubleshooting: Sysadmins use PTR records for identifying devices on networks.
- Improved logging: PTR records make logs more readable by showing domain names instead of IP addresses.
While A and AAAA records help you find where a domain lives, PTR records help you find out who lives at a particular IP address. It’s like the difference between “Where does John live?” and “Who lives at 123 Main St?”
How to set up your PTR records
Unlike other DNS records, you typically can’t set up PTR records directly in your domain’s DNS settings. PTR records are usually managed by the owner of the IP address block, and that’s typically your Internet Service Provider (ISP) or hosting provider.
1. Identify your IP address
You need to know the IP address you want to set up a PTR record for. If you’re not sure, you can usually find this in your hosting control panel or by contacting your hosting provider.
2. Contact your ISP or hosting provider
Reach out to your ISP or hosting provider and ask them to set up a PTR record for your IP address. When you contact them, you’ll need to provide:
- The IP address you want to set up the PTR record for
- The domain name you want it to point to
For example, you might say: “I’d like to set up a PTR record for the IP address 192.0.2.1 to point to mail.example.com.”
3. Verify the setup
Once your provider has set up the PTR record, check that it’s working correctly. You can do this using a command line tool or an online service.
Using the command line (if you’re feeling a bit techy):
- Open your command prompt or terminal
- Type nslookup <your-ip-address> and hit enter
- You should see your domain name in the results
For example:
> nslookup 192.0.2.1
1.2.0.192.in-addr.arpa name = mail.example.com.
4. Set up forward DNS (A or AAAA record)
You should also set up a forward DNS record (an A record for IPv4 or AAAA for IPv6) that points your domain to the IP address.
This you can usually do in your domain’s DNS settings:
- Log into your domain registrar or DNS provider
- Find the DNS management section
- Add an A record (or AAAA for IPv6) pointing your domain to your IP address
For example:
mail.example.com. IN A 192.0.2.1
Common PTR record mistakes to avoid
Here are a handful of common PTR record mistakes we see:
- Mismatched forward and reverse DNS: Make sure your PTR record and A/AAAA record match.
- Incorrect formatting: PTR records are picky about format. Make sure you’re using the correct syntax.
- Forgetting to update: If you change your IP address, don’t forget to update your PTR record.
- Using a subdomain without proper setup: If you’re using a subdomain in your PTR record (like mail.example.com), make sure that subdomain is properly set up in your forward DNS too.
Get your email sending right with Valimail
Unfortunately, managing PTR records is just one piece of the complex puzzle that is email authentication and deliverability. Getting your emails to land in the inbox instead of the spam folder is easier said than done. You have to worry about:
- Setting up and maintaining PTR records
- Configuring SPF, DKIM, and DMARC correctly
- Keeping up with ever-changing email authentication standards
- Monitoring your email reputation
This is where we can help. Valimail provides the following to streamline your email authentication:
- Automated DMARC Enforcement: Valimail automatically enforces DMARC for you, which includes managing SPF, DKIM, and yes, those important PTR records.
- Real-time monitoring: We keep an eye on your email authentication 24/7, so you don’t have to.
- Easy-to-use dashboard: No more digging through command lines or DNS records. Our user-friendly dashboard gives you a bird’s-eye view of your email authentication status.
- Expert support: Our team of email authentication experts is always ready to help.
- Ongoing compliance: Valimail keeps your authentication up to date. We’re always one step ahead, so you don’t have to be.
Want to see how Valimail can help you reach (and maintain) DMARC enforcement?