What is Reverse DNS and Why Does It Matter?

May 8, 2024

You probably know that DNS translates domain names to IP addresses. Reverse DNS (rDNS) does exactly what it sounds like - it translates IP addresses back to domain names.

How Reverse DNS Works

When you do a reverse DNS lookup on an IP address like 142.250.185.78, you might get back a hostname like lga25s71-in-f14.1e100.net (that's actually Google).

Technically, reverse DNS uses PTR (pointer) records in a special domain called in-addr.arpa. The IP address is reversed and appended to this domain. So 142.250.185.78 becomes 78.185.250.142.in-addr.arpa.

Why Reverse DNS Matters

Email Deliverability

This is the big one. Email servers check reverse DNS to verify that sending servers are legitimate. If your mail server's IP doesn't have a PTR record, or if it doesn't match your sending domain, your emails are more likely to be marked as spam.

Many email providers will outright reject messages from IPs without proper reverse DNS.

Security and Logging

When reviewing server logs, seeing IP addresses isn't very helpful. Reverse DNS lets you see hostnames instead, making it easier to identify who's connecting to your servers.

Security tools also use reverse DNS to help identify suspicious traffic.

Verification and Trust

Some services check reverse DNS as part of their verification process. A properly configured PTR record shows that you control both the IP address and the domain - you're not just some random spammer.

Setting Up Reverse DNS

Here's the tricky part: you can't set PTR records yourself through your domain registrar. Reverse DNS is controlled by whoever owns the IP address - usually your hosting provider or ISP.

For most hosting providers: 1. Log into your hosting control panel 2. Look for "Reverse DNS" or "PTR Record" settings 3. Set the PTR to match your mail server's hostname

For cloud providers like AWS, Azure, or Google Cloud, you'll need to request PTR records through their support or specific interfaces.

Best Practices

1.

Make sure forward and reverse DNS match

- If your PTR record says mail.example.com, then mail.example.com should resolve back to that IP address.

2.

Use meaningful hostnames

- PTR records like server1.example.com are better than random strings.

3.

Don't forget IPv6

- If you're using IPv6, you need AAAA records and corresponding PTR records.

4.

Test your setup

- Use tools like MXToolbox to verify your reverse DNS is configured correctly.

Checking Reverse DNS

You can check reverse DNS from the command line:

Windows:

nslookup 142.250.185.78

Mac/Linux:

dig -x 142.250.185.78

Or use online tools that check PTR records.

Reverse DNS is one of those things that's easy to overlook but can cause real problems - especially with email. Take a few minutes to make sure yours is set up correctly.