From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search

Revision as of 10:49, 24 January 2006

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.

nslookup on unix-like systems is deprecated; use dig instead.

nslookup on Windows can be useful to know, so here's a few basics:

  1. open a DOS-window by clicking Start, choosing "Run..." and entering "cmd.exe" and clicking OK
  2. 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
where 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:
>set type=NS
Type can be the standard types of DNS changes, including A, NS, MX, PTR, SOA, etc.
When you've set all the options you want set, typing in the domain name will give you the info you want:

> server
Default Server:  []

Server:  []

Non-authoritative answer:

> set type=NS
Server:  []

Non-authoritative answer:      nameserver =      nameserver =      nameserver =      nameserver =
Personal tools