How to check PTR records with nslookup
Query PTR (pointer) records with nslookup to find the domain name associated with an IP address using reverse DNS lookup.
Query PTR (pointer) records with nslookup to find the domain name associated with a specific IP address through reverse DNS lookup.
Prerequisites
- nslookup installed on the system (included by default on Linux, macOS, and Windows).
- Terminal or command prompt access.
- The IP address to look up.
Step-by-Step: Check PTR Records with nslookup
Open a terminal and run nslookup with the
-debugflag followed by the IP address to query its PTR record:nslookup -debug 203.0.113.50nslookup performs a reverse DNS lookup by querying the
in-addr.arpazone. The PTR record maps an IP address back to its associated domain name. This is the reverse of an A record, which maps a domain to an IP address. The-debugflag displays the full DNS response, including the ANSWERS section where the PTR record appears.Example output:
Server: 192.168.0.1 Address: 192.168.0.1#53 ------------ QUESTIONS: 50.113.0.203.in-addr.arpa, type = PTR, class = IN ANSWERS: -> 50.113.0.203.in-addr.arpa name = host.example.com. ttl = 28040 AUTHORITY RECORDS: ADDITIONAL RECORDS: ------------ Non-authoritative answer: 50.113.0.203.in-addr.arpa name = host.example.com.To check a PTR record without debug output, run nslookup with the IP address alone:
nslookup 203.0.113.50nslookup returns the domain name under the "Non-authoritative answer" section.
How to Verify
nslookup displays the PTR record under the "Non-authoritative answer" section. The output shows the reversed IP address in
in-addr.arpa format and the associated domain name. Confirm the domain name matches the expected hostname for that IP address.
To cross-check, perform a forward lookup on the returned domain name:
nslookup host.example.comnslookup should return the original IP address, confirming that the forward (A) and reverse (PTR) records match.
Common Issues
nslookup returns "server can't find" for the IP address.** The IP address does not have a PTR record configured. The owner of the IP address block (typically the hosting provider or ISP) manages reverse DNS zones. Contact the IP address provider to add a PTR record.
nslookup returns a generic hostname like "host-203-0-113-50.isp.com".The ISP assigned a default PTR record to the IP address. A custom PTR record requires the IP address owner to update the reverse DNS zone. This is common for dedicated servers and mail servers that need proper reverse DNS for email deliverability.
Forward and reverse DNS records do not match.The A record for the domain points to the IP address, but the PTR record for that IP points to a different domain. This mismatch can cause email delivery failures, as many mail servers verify forward-confirmed reverse DNS (FCrDNS).