Reverse DNS (rDNS) is the opposite of the DNS. The DNS is queried for the IP address of a certain hostname. In reverse DNS, the hostname is returned for a certain IP address.
Reverse DNS uses a pointer record (PTR) to match an IP address with a domain or subdomain. PTR records are generally set with a hosting provider or server level.
Table of Contents
What Is Reverse DNS?
Reverse DNS is a DNS lookup of a domain name from an IP address. While a regular DNS request resolves an IP address from a domain name, rDNS does the opposite, hence the name reverse.
A PTR record is used to perform reverse DNS lookups. Pointer records are configured within Address and Routing Parameter Area (in-addr.arpa
) domains. If there is no PTR record set up, a reverse DNS lookup is unsuccessful.
How Does Reverse DNS Lookup Work?
Reverse DNS works by looking up query DNS servers for a pointer record (PTR). A PTR record maps an IPv4 or IPv6 address to the canonical name for the host. If there is no PTR record on the server, it cannot resolve a reverse lookup.
PTR records store reverse DNS entries, with their IP address reversed and .in-addr.arpa
appended to each record. For example, PTR stores the IP address 103.35.69.44
as 44.69.35.103.in-addr.arpa
, pointing back to its designated host name.
It is advisable to have a proper reverse DNS record (PTR) set up, especially when running an SMTP/mail server.
The following image illustrates the difference between DNS and rDNS lookup:
In IPv6, PTR records store rDNS entries within the .ip6.arpa
domain instead of .in-addr.arpa.
When a domain name has a valid rDNS, you can access it by entering its IP address in your browser.
What Is Reverse DNS Lookup Used For?
Reverse DNS is particularly useful for those running an outgoing mail server. Besides mail servers, there are several reasons for using rDNS:
- Filtering spam emails. Most email servers use rDNS to block spam mail, rejecting messages from IP addresses without rDNS. However, rDNS is mainly used as an additional layer of protection because it isn’t reliable as some legitimate mail servers don’t have properly set up rDNS records.
- Analytics. Reverse DNS helps provide human-readable data in analytics, rather than listing logs of IP addresses.
- Tracking website visitors. IP addresses of website visitors remain in the visit logs and can help you get an idea of your website audience. Tracking website visitors is beneficial for B2B lead generation.
- Smooth network experience. Reverse DNS prevents you from encountering problems with most enterprise management systems, r-commands, SMTP servers, or network backup systems. rDNS is also one of the basic requirements for running some Internet protocols.
- Security. A reverse IP lookup can be used to find the IP address’ A records, mapping a domain name to the physical IP address of the device hosting that domain. The results help determine the virtual hosts served from a web server and identify server vulnerabilities.
How do I setup rDNS?
If you use an ESP such as Google Apps or Office 365 they are responsible for configuring rDNS for all of their IP addresses. This is also the case if you’re using any email marketing platform like MailChimp to send emails.
You are only responsible for configuring rDNS if you are setting up a mail server, or your ESP has provided you with your own dedicated ip.
In order to setup rDNS you must meet the following requirements:
- You must have access to an Authoritative Nameserver or your DNS in order to make the necessary changes.
- Your sending IP must have a pointer (PTR) record in your DNS that resolves to a valid hostname.
- Your hostname must have an A record in your DNS that matches your sending IP address.
Step 1: Create a Reverse DNS Zone
- The hostname for the zone should start with a portion of your IP address written backwards followed by .in-addr.arpa.
- If your IP Address is
103.35.69.44
, you need to remove the final octet which leaves you with103.35.69
- Now you need to reverse
103.35.69
which is: 69.35.103 - Now append .in-addr.arpa to
103.35.69
- Now you have the completed reverse zone domain of 69.35.103.in-addr.arpa
Step 2: Create a PTR Record
- Add a new PTR record.
- Name it with the final digit of your IP address. In our example above it would be 127.
- For the Canonical Hostname, enter the domain name you’d like the IP address to resolve to: mailserver.example.com
If you don’t meet the requirements above, you may need to open a technical support ticket with your hosting provider or ESP and ask for the following:
- Please create a PTR record for the IP address X.X.X.X resolving for yourdomain.example.com.
Example rDNS records:
- The rDNS or PTR record for IP address
103.35.69.44
is mail-io1-f41.google.com - The A record for mail-io1-f41.google.com is
103.35.69.44
- The PTR record matches the A record therefore rDNS has been properly configured.