DNS - PTR record (Pointer)
Table of Contents
About
A PTR record is a DNS record with the pointer type (PTR type) .
It's used to permits or set up a reverse lookup where an ip address as input gives you its domain name.
Only the owner of the IP can set a reverse record, not the owner of the domain. Therefore if you want to set a PTR record:
- for a server, you need to do it at your server provider
- for your internet connection, you need to ask it to your telecom provider
Authentication
A PTR record is important because it's a part of request authentication on the Internet.
ie when a server got a request from an IP, it performs:
- first an reverse lookup to determine its host name
- then a forward lookup to validate the host name
If they don't match, the request is classified as bad.
For instance:
- this is the way to validate google bot
Format
The PTR records are stored within the .arpa top-level domain.
Ipv4
142.175.106.72.in-addr.arpa. 86400 IN PTR name.apex.domain
where:
- 142.175.106.72 is the IP
- in-addr.arpa is the namespace (for Ipv4) where the records are stored. ie in the arpa domain
Ipv6
IPv6 PTR records are stored under the IPv6 address, reversed and converted into four-bit sections (as opposed to 8-bit sections, as in IPv4), plus “.ip6.arpa”.