PTR: reverse pointer
An IP address's name, stored in a reverse zone. dig -x <ip> returns it.
| Type number | 12 |
| RFC | 1035 |
| RDATA | A single fully-qualified domain name |
| Lives in | in-addr.arpa or ip6.arpa zones |
What it holds#
A single FQDN pointing back from an IP address, the reverse of an A record:
53.100.51.198.in-addr.arpa. PTR host1.example.com.Read backwards: the IP 198.51.100.53 says its name is host1.example.com.
When to use it#
- Mail. Receiving servers run a forward-confirmed reverse DNS (FCrDNS) check: the PTR target's forward record must point back to the sending IP. Mail from an IP with no PTR, or a PTR that fails this check, is commonly treated as a spam signal. See email-records.
- Logging.
sshdand similar daemons resolve client IPs for logs, but only withUseDNS yes; the default has beennofor years (sshd_config(5)). - Observability. dnstap and flow-log pipelines commonly enrich records with reverse-DNS names.
When not to use it#
- For aliasing or load balancing: PTR is one name per IP by convention (see Gotchas).
- In forward zones, except DNS-Based Service Discovery (RFC 6763), which legitimately publishes PTR under names like
_ipp._tcp.example.comto enumerate service instances.
dig example#
Asks which name belongs to the address 1.1.1.2.
dig @1.1.1.1 2.1.1.1.in-addr.arpa PTRGO NOERROR and one PTR naming the host
NO GO NXDOMAIN, which means the reverse name does not exist
example.isitdns.net has no PTR: reverse zones are delegated by the RIR or ISP that owns the address block, not by the forward zone's owner, so a teaching zone cannot publish one. Cloudflare publishes a PTR for 1.1.1.2, used here as a live answer. -x 1.1.1.2 is shorthand dig expands into the same query.
RFC 1035 section 3.3.12 defines the RDATA; section 3.5 defines in-addr.arpa. RFC 3596 section 2.5 defines the ip6.arpa nibble form used for IPv6.
DoH query (HTTPS)#
DoH is DNS-over-HTTPS. The application/dns-json format below is a Cloudflare/Google convention, not part of RFC 8484 itself, which defines only the binary application/dns-message type.
curl -s -H 'accept: application/dns-json' \
'https://cloudflare-dns.com/dns-query?name=2.1.1.1.in-addr.arpa&type=PTR' \
| jq .Answer[
{
"name": "2.1.1.1.in-addr.arpa",
"type": 12,
"TTL": 110,
"data": "security.cloudflare-dns.com."
}
]The TTL field counts down as the resolver's cache entry ages, so your number will differ run to run.
Gotchas#
- One PTR per IP, in practice. RFC 1035 allows multiples; tooling expects one. Pick a canonical hostname per IP and stick with it.
- PTR must be in the right zone. A PTR for
198.51.100.20lives in100.51.198.in-addr.arpa. If51.198.in-addr.arpaexists but100.51.198.in-addr.arpawas never delegated, resolution stops at the parent and the PTR is invisible. - FCrDNS asymmetry. The PTR points to a name; that name's A or AAAA record must point back to the original IP. If forward and reverse disagree, mail filters and security tools treat the host as suspicious.
- RFC 1918 reverse leaks. A wide-open recursive resolver can forward
192.168.x.x.in-addr.arpaqueries to the Internet, leaking internal addressing. RFC 6303 (Locally Served DNS Zones) standardizes an empty zone that answersNXDOMAINfor private reverse space; BIND and Unbound ship it enabled by default. See reverse-dns for the AS112 backstop. - Documentation addresses have no reverse zone. RFC 5737 (
192.0.2.0/24,198.51.100.0/24,203.0.113.0/24) and RFC 3849 (2001:db8::/32) addresses are not routed. RFC 6303 section 4.2 lists their reverse zones as locally served, so a live PTR lookup against one returnsNXDOMAINfrom the resolver's own empty zone (verified:2.1.1.1.in-addr.arpaanswers,53.100.51.198.in-addr.arpadoes not). Use these ranges in zone-file examples only. - Public reverse not under your control. Reverse DNS for a public IP is delegated by your RIR/ISP, not your zone. Getting a custom PTR for a static public IP usually means asking your ISP.