DNS PTR record definition
A DNS PTR record (or Pointer record) is a type of DNS record that provides the domain name linked to a specific IP address. So through a DNS PTR record, you can find out the domain name of an IP address. For example, if you only know the IP address of a certain site, you can find the site’s actual name (domain name) through a DNS PTR record.
The DNS PTR record is the exact opposite of a DNS “A” record, which provides the IP address linked to a certain domain name. And since the DNS PTR record is the opposite of a DNS “A” record, an “A” record should exist for every DNS PTR record. DNS PTR records are also used for the reverse DNS lookup.
In addition, outgoing mail servers use DNS PTR records so that the emails sent through the mail servers aren’t flagged as spam. All emails from mail servers that don’t use DNS PTR records are marked as spam because a DNS PTR record is necessary to prove that an email address or domain is valid.
See also: DNS server, DNS proxy, DNS cache, DNS filtering, DNS flushing, DNS hijacking, DNS port, DNS query, DNS record, DNS redirection, DNS resolution, DNS sinkhole, DNS record, domain
DNS PTR record use cases
- Security. If the email addresses that you communicate with don’t have a DNS PTR record, it means that their domains aren’t validated, and they might be risky. Such email addresses might send you spam or links that could infect your devices with malware.
- Validation. Having a DNS PTR record shows others that your domain and IP address are valid and shows them that your emails aren’t spam and don’t have bad intentions.
- Investigation. You can use a DNS PTR record to see where certain traffic originates from, especially if the system through which the traffic was created only stores IP addresses and not domain names.
An example of a PTR record
An example of a PTR record would look like this:
- 5.4.3.2.in-addr.arpa. IN PTR example.com.
In this case, the PTR record maps the IP address 2.3.4.5 to the domain name example.com for reverse DNS lookup.
How are PRT records stored?
PTR records are stored in a special DNS zone called a reverse DNS zone. Unlike standard DNS zones, which map domain names to IP addresses, reverse DNS zones map IP addresses to domain names. These zones are typically managed by Internet Service Providers (ISPs) or network administrators and are structured using the IP address in reverse order, followed by the domain "in-addr.arpa" (for IPv4) or "ip6.arpa" (for IPv6).
A record vs. PTR record
An A record maps a domain name to its corresponding IP address, while a PTR record does the opposite, mapping an IP address to its associated domain name for reverse DNS lookups.
How to set up a PTR record
To set up a PTR record for reverse DNS, follow these steps:
1. Contact your hosting provider or ISP: Only the owner of the IP address block (usually your ISP) can create PTR records. Request that they create the PTR record for your IP address.
2. Provide the required details: Give them the IP address and the domain name you'd like associated with it.
3. Verify the setup: Once the PTR record is set, verify it by performing a reverse DNS lookup to ensure the IP correctly resolves to the domain.
Since PTR records are handled by the IP address owner, they typically need to be set up through your ISP or network administrator, not through your DNS provider.