Common Tasks

You’ll come to use nslookup for little chores almost every day: for example, finding out the IP address or MX records for a given domain name or querying a particular name server for data. We’ll cover these common tasks before moving on to the more occasional stuff.

Looking Up Different Data Types

By default, nslookup looks up the address for a name or the name for an address. You can look up any data type by changing the querytype, as we show in this example:

C:\> nslookup 
Default Server:  terminator.movie.edu 
Address:  192.249.249.3 

> misery
                -- Look up address 
Server:  terminator.movie.edu 
Address:  192.249.249.3 

Name:    misery.movie.edu 
Address:  192.253.253.2 

> 192.253.253.2
                -- Look up name 
Server:  terminator.movie.edu 
Address:  192.249.249.3 

Name:    misery.movie.edu 
Address:  192.253.253.2 

> set q=mx
                -- Look up MX data 
> wormhole Server:  terminator.movie.edu 
Address:  192.249.249.3 
wormhole.movie.edu      MX preference = 10, mail exchanger = wormhole.movie.edu 
wormhole.movie.edu      internet address = 192.249.249.1 
wormhole.movie.edu      internet address = 192.253.253.1 

> set q=any
                -- Look up data of any type 
> diehard 
Server:  terminator.movie.edu 
Address:  192.249.249.3 

diehard.movie.edu       internet address = 192.249.249.4 
diehard.movie.edu       MX preference = 10, mail exchanger = diehard.movie.edu 
diehard.movie.edu       internet address = 192.249.249.4

These are only a few of the valid DNS data types, of course. For the complete list, see Appendix A.

Authoritative Versus Nonauthoritative ...

Get DNS on Windows 2000, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.