pavement

Nslookup

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
m
(On Windows systems)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[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]] 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.
+
== On Unixlike systems ==
 +
[[nslookup]] on unix-like systems is '''<font color="red">deprecated</font>'''; use [[dig]] instead.
  
 +
== On Windows systems ==
 
[[nslookup]] on Windows can be useful to know, so here's a few basics:
 
[[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
+
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.     
# start the program by typing in "nslookup".  
+
 
  This will change the prompt from whatever drive you were in (e.g., "C:\>") to just ">"
+
If you would like to change this, run  
  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
 
  > server 10.10.10.100
 
   
 
   
where 10.10.10.100 is the IP of the different server you would like to query.  
+
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:
  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
 
  >set type=NS
 
   
 
   
Type can be the standard types of DNS changes, including A, NS, MX, PTR, SOA, etc.
+
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:
  When you've set all the options you want set, typing in the domain name will give you the info you want:
+
 
   
 
   
  >google.com
+
  > freebsdwiki.net
 
   
 
   
 
  > server 10.64.0.8
 
  > server 10.64.0.8
Line 28: Line 25:
 
  Address:  10.64.0.8
 
  Address:  10.64.0.8
 
   
 
   
  > google.com
+
  > freebsdwiki.net
 
  Server:  [10.64.0.8]
 
  Server:  [10.64.0.8]
 
  Address:  10.64.0.8
 
  Address:  10.64.0.8
 
   
 
   
 
  Non-authoritative answer:
 
  Non-authoritative answer:
  Name:    google.com
+
  Name:    freebsdwiki.net
  Addresses72.14.207.99, 64.233.187.99
+
  Address:  64.15.172.73
 
   
 
   
 
  > set type=NS
 
  > set type=NS
  > google.com
+
  > freebsdwiki.net
 
  Server:  [10.64.0.8]
 
  Server:  [10.64.0.8]
 
  Address:  10.64.0.8
 
  Address:  10.64.0.8
 
   
 
   
 
  Non-authoritative answer:
 
  Non-authoritative answer:
  google.com     nameserver = ns1.google.com
+
  freebsdwiki.net     nameserver = ns1.jrssystems.net
  google.com     nameserver = ns2.google.com
+
  freebsdwiki.net     nameserver = ns2.jrssystems.net
  google.com      nameserver = ns3.google.com
+
 
  google.com      nameserver = ns4.google.com
+
  ns1.jrssystems.net    internet address = 64.15.152.73
 +
  ns2.jrssystems.net    internet address = 64.15.152.73
 
  >
 
  >
  
Line 51: Line 49:
 
  > exit
 
  > exit
 
and you'll be dropped back to your C:\>
 
and you'll be dropped back to your C:\>
 +
 +
[[Category:System Commands]]
 +
[[Category:DNS]]

Latest revision as of 12:11, 6 October 2007

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.

[edit] On Unixlike systems

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

[edit] 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:

>set type=NS

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

> 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 = 64.15.152.73
ns2.jrssystems.net     internet address = 64.15.152.73
>

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