Understanding DNS PTR Record

DNS PRT record is short for pointer record. It is one of the common Domain Name System (DNS) records. It resolves an IP address to a domain or hostname. It is also called DNS reverse record.



Purpose of DNS PTR record

PTR records are mainly used to check if the server name is actually associated with the IP address from where the connection was initiated.


Some applications require reverse DNS records (PTR records) to resolve IP addresses to domain names. For example, applications that use SMTP require a PTR record that points to the domain from which an email is being sent. Without that record, spam filters can mark emails with low reputation, which causes email to end up in spam folders or not be sent at all.


IP addresses of all Intermedia mail servers already have PTR records created.



Example of DNS PTR Record

Here is the PTR record for IP 185.230.63.186. It points to the domain name unalocated.63.wixsite.com.


% dig -x 185.230.63.186

; <<>> DiG 9.10.6 <<>> -x 185.230.63.186
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37914
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 6, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1280
;; QUESTION SECTION:
;186.63.230.185.in-addr.arpa.	IN	PTR

;; ANSWER SECTION:
186.63.230.185.in-addr.arpa. 0	IN	PTR	unalocated.63.wixsite.com.

How to create a PTR record

PTR record is configured and controlled by the IP block owners. Often the reverse DNS host name is configured to indicate the netblock owner, such as ISP or web hosting provider.


If we are hosting a server with a dedicated IP address and would like to have PTR DNS configured (required if we are running an Internet mail server), the PTR record will usually be configured through our IP block hosting provider (usually the server hosting company).


If we own the DNS server on our own, we need to create a reverse DNS zone. The hostname for the zone has to be in a very specific format. It starts with a portion of our IP address written backward followed by .in-addr.arpa.


For exmaple,

we need to create .63.230.185.in-addr.arpa.zone file and add 186 record to point to unalocated.63.wixsite.com.



Check PTR Record

Perform a reverse lookup for the relevant IP address with the following Dig command:


$ dig -x 1.2.3.4


we can check the reverse DNS with Nslookup as well. A sample is shown below:


$ nslookup 1.2.3.4


The outputs for both methods will show which hostname does this IP address belongs to.



PTR Record FAQ

If a domain has no PTR record, or if the PTR record contains the wrong domain, email services may block all emails from that domain.


PTR records provide trust that the given hostname or a domain are connected to the IP address. The PTR records are a must-have for outgoing mail servers because most of the mail providers reject or mark as spam messages received by mail servers without valid reverse DNS configuration (missing PTR or mismatch A record for the hostname).


This has become standard so to say as all mail providers try to keep the spam out of their clients' Inbox. The proper Reverse DNS configuration is always a good idea to avoid any potential email filtrations.



Related:


31 views