DNS reverse lookup in Windows 7 and Linux using - nslookup
In a previous article "Unix reverse dns lookup - using dig command"
http://forum.ivorde.com/unix-reverse-dns-lookup-using-dig-command-ptr-dns-record-type-t19521.html - some of the most used dns record types and it focused on dns reverse lookups - PTR records - that return a human readable fqdn for an ip address.
Below are few examples of dns reverse lookups using "nslookup" tool available in both Linux and Windows.
First using oneline nslookup command:
Code:
C:\Users\Andrei>nslookup -querytype=ptr 8.8.8.8
Server: UnKnown
Address: 172.16.20.2
Non-authoritative answer:
8.8.8.8.in-addr.arpa name = google-public-dns-a.google.com
8.8.8.in-addr.arpa nameserver = ns3.google.com
8.8.8.in-addr.arpa nameserver = ns1.google.com
8.8.8.in-addr.arpa nameserver = ns2.google.com
8.8.8.in-addr.arpa nameserver = ns4.google.com
ns1.google.com internet address = 216.239.32.10
ns2.google.com internet address = 216.239.34.10
ns3.google.com internet address = 216.239.36.10
ns4.google.com internet address = 216.239.38.10
Using interactive nslookup mode:
Code:
C:\Users\Andrei>nslookup -querytype=ptr 8.8.8.8
Server: UnKnown
Address: 172.16.20.2
Non-authoritative answer:
8.8.8.8.in-addr.arpa name = google-public-dns-a.google.com
8.8.8.in-addr.arpa nameserver = ns3.google.com
8.8.8.in-addr.arpa nameserver = ns1.google.com
8.8.8.in-addr.arpa nameserver = ns2.google.com
8.8.8.in-addr.arpa nameserver = ns4.google.com
ns1.google.com internet address = 216.239.32.10
ns2.google.com internet address = 216.239.34.10
ns3.google.com internet address = 216.239.36.10
ns4.google.com internet address = 216.239.38.10
Both of the above examples perform reverse lookup for IP 8.8.8.8 - they return the PTR dns record.
How to perform DNS reverse lookup using nslookup to a specific server:The basic nslookup syntax, as per manual is, quote:
Quote:
nslookup [-option] [name | -] [server]
To query a specific server for PTR record for an Ip address / do reverse lookup:
Code:
C:\Users\Andrei>nslookup -querytype=ptr 82.76.71.249 8.8.8.8
Server: google-public-dns-a.google.com
Address: 8.8.8.8
Non-authoritative answer:
249.71.76.82.in-addr.arpa name = mail.ivorde.ro
The last argument is the target server to query.
The above examples are valid for both Windows and Linux.