- HOME
- Security and Privacy
- PTR records explained
PTR records explained
- Published : April 30, 2024
- Last Updated : April 30, 2024
- 355 Views
- 4 Min Read
Email security is one of the prime concerns in the present digital landscape. With multiple security measures in place, one small but efficient method to protect your emails is PTR records. This article will cover everything about these records and how you can use them.
What are PTR records used for?
A PTR record is used to obtain the domain name from the IP address available. PTR records are used by servers to authenticate the sender's identity. They are crucial in identifying spoofed emails.
Spammers usually modify the sending address to make it look like it's from a legitimate server. The receiving server can perform a DNS lookup and a reverse DNS lookup to match the sending domain with the IP. If there is a mismatch or if the PTR records arent available, this is a signal that the sender is a spammer.
This method ensures your domain is not spoofed or used for spamming activities.
Apart from this, anti-spam filters depend on PTR records to verify sender details. A misconfigured or a missing PTR record will result in delivery issues on the recipient's end. A PTR record is effective for providing a smooth delivery.
DNS lookup
When you search for a website, your search engine's server will first locate the address where the domain is available. This address is called an IP address. As mentioned before, the receiving server performs a DNS lookup and a reverse DNS lookup to check if the sending domain and IP address match.
This address will be available in a repository called the DNS server. Every domain will have their respective DNS servers which contain the IP addresses of websites hosted in them. So when a search is made for a website, the search engine will first locate the DNS that corresponds to the domain of the website. Once the DNS is found, the IP will be fetched.
The DNS server has multiple records associated with a domain. The major ones being: A record, AAAA record, CNAME record, MX record, and NS record. The A record holds the IP address for a particular domain.
When you type in www.example.com, your search engine's server will contact a series of servers to locate the DNS where your domain's IP address is located. The server will then contact the IP address which will return example.com's webpage.
The above process is called "forward DNS lookup." Forward DNS lookup is the method of obtaining an IP address using a domain name.
There is another method called the reverse lookup, where the domain's details are fetched using their IP address. The records responsible for this are PTR records. The reverse DNS lookup helps with email authentication, security analysis, and more.
How to add a PTR record
PTR records are created by reversing the IP address and by adding the suffix ".in-addr.arpa" to it.
Adding a PTR record varies from one DNS provider to another. Some providers automatically add PTR records for domains hosted with them, while you need to contact support for others.
To add a PTR record yourself, you should define a zone in the DNS server. Zones in DNS are partitions of the DNS space that help decentralize the DNS server and split the administrative load between admins. There are multiple zones in a DNS server and one such zone is the reverse lookup zone.
Most DNS providers will have this DNS zone specified in their settings section. So, all you have to do is choose to add the PTR record from the dropdown in the DNS settings section. Next, obtain the IP address for which you wish to add the PTR records and reverse it. For example, if your IP address is 123.1.0.205, then your PTR record will be 205.0.1.123.in-addr.arpa.
The last part of the suffix in the IP address, "arpa", is the top-level domain where these PTR records will be stored. "In-addr.arpa" is the second-level domain where the PTR records will be stored if they use IPv4. If you use IPv6, simply use the reversed IP with the suffix ip6.arpa.
Please note, you can have only one PTR record for your domain.
Ways to check your PTR records
There are multiple online tools that help you check the PTR records for your domain. Popular options include MXtoolbox, and nslookup.io. Navigate to their page and enter your domain name or IP address. You will see the results.
Alternatively, if you wish to view the PTR records manually, you can do so from your machine's command prompt window using two commands:
Dig
nslookup
Depending on your machine type, navigate to the command prompt and enter the following command:
dig PTR 123.0.1.205.in-addr.arpa
You will find the domain associated with the PTR record on the screen. You can also use:
dig -x 123.0.1.205
To use the nslookup command, type in the following command in your command prompt window:
nslookup -debug 123.0.1.205
Wrapping up
PTR records are one method you can use to prevent spamming and spoofing attempts. To get maximum deliverability for your emails, especially transactional emails, check out our deliverability guide. This will give you a holistic approach to email deliverability.