nslookup is used to query DNS servers. Popular among MS Windows expatriates because there is also a Windows command-line tool called nslookup that does exactly the same thing the unix version does.
On Unixlike systems
nslookup on unix-like systems is deprecated; use dig instead.
On Windows systems
nslookup on Windows can be useful to know, so here's a few basics:
open a DOS-window by clicking Start, choosing "Run..." and entering "cmd.exe" and clicking OK. Start the program by typing in "nslookup". This will change the prompt from whatever drive you were in (e.g., "C:\>") to just ">". By default, you will be set to use whatever your primary DNS server is set to in your Network Properties.
If you would like to change this, run
> server 10.10.10.100
where 10.10.10.100 is the IP of the different server you would like to query. By default, typing in a domain/hostname will get you the A/HOST entry, if you want to change the TYPE of query you do, you'll need to set it:
Type can be the standard types of DNS changes, including A, NS, MX, PTR, SOA, etc. (see [DNS record types]). When you've set all the options you want set, typing in the domain name will give you the info you want:
> freebsdwiki.net > server 10.64.0.8 Default Server: [10.64.0.8] Address: 10.64.0.8 > freebsdwiki.net Server: [10.64.0.8] Address: 10.64.0.8 Non-authoritative answer: Name: freebsdwiki.net Address: 184.108.40.206 > set type=NS > freebsdwiki.net Server: [10.64.0.8] Address: 10.64.0.8 Non-authoritative answer: freebsdwiki.net nameserver = ns1.jrssystems.net freebsdwiki.net nameserver = ns2.jrssystems.net
ns1.jrssystems.net internet address = 220.127.116.11 ns2.jrssystems.net internet address = 18.104.22.168 >
When you're done with all the lookups you want to do, exit the nslookup shell by typing in
and you'll be dropped back to your C:\>