Testing Your Setup with nslookup

If you have correctly set up your local domain and your connection to the Internet is up, you should be able to look up a local and a remote domain name. We’ll step you through the lookups with nslookup. This book contains an entire chapter on this topic (Chapter 12), but we will cover nslookup in enough detail here to do basic name-server testing.

Look up a local name

You can use nslookup to look up any type of resource record, and it can be directed to query any name server. By default, it looks up A (address) records using the name server on the local system. To look up a host’s address with nslookup, run nslookup with the host’s name as the only argument. A lookup of a local name should return almost instantly.

We ran nslookup to look up carrie:

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

Name:    carrie.movie.edu 
Address:  192.253.253.4

If looking up a local name works, your local name server has been configured properly for your domain. If the lookup fails, you’ll see something like this:

*** terminator.movie.edu can't find carrie: Non-existent domain

This means that either carrie is not in your zone—check the DNS console or the zone datafile—or some name server error occurred (but you should have caught the error when you checked the Event Log).

Look up a local address

When nslookup is given an address to look up, it knows to send a PTR query instead of an address query. We ran nslookup to look up carrie’s address:

C:\> ...

Get DNS on Windows Server 2003, 3rd 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.