pavement

Nslookup

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
m (readability)
m
Line 47: Line 47:
 
  google.com      nameserver = ns4.google.com
 
  google.com      nameserver = ns4.google.com
 
  >
 
  >
 +
 +
When you're done with all the lookups you want to do, exit the ''nslookup'' shell by typing in
 +
> exit
 +
and you'll be dropped back to your C:\>

Revision as of 09:52, 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 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:

>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:

>google.com

> server 10.64.0.8
Default Server:  [10.64.0.8]
Address:  10.64.0.8

> google.com
Server:  [10.64.0.8]
Address:  10.64.0.8

Non-authoritative answer:
Name:    google.com
Addresses:  72.14.207.99, 64.233.187.99 

> set type=NS
> google.com
Server:  [10.64.0.8]
Address:  10.64.0.8

Non-authoritative answer:
google.com      nameserver = ns1.google.com
google.com      nameserver = ns2.google.com
google.com      nameserver = ns3.google.com
google.com      nameserver = ns4.google.com
>

When you're done with all the lookups you want to do, exit the nslookup shell by typing in

> exit

and you'll be dropped back to your C:\>

Personal tools