Displaying DNS records
One of the main uses of nslookup is to examine your DNS configuration to make sure that it's set up properly. To do that, follow these steps:
- At a command prompt, type nslookup without any parameters.
nslookup displays the name of the default name server and displays the > prompt.
C:\>nslookup Default Server: ns1.orng.twtelecom.net Address: 188.8.131.52 >
- Type the subcommand set type=any.
nslookup silently obeys your command and displays another prompt:
> set type=any >
- Type your domain name.
nslookup responds by displaying the name servers for your domain:
> lowewriter.com Server: ns1.orng.twtelecom.net Address: 184.108.40.206 Non-authoritative answer: lowewriter.com nameserver = NS000.NS0.com lowewriter.com nameserver = NS207.PAIR.com lowewriter.com nameserver = NS000.NS0.com lowewriter.com nameserver = NS207.PAIR.com >
- Use a server command to switch to one of the domain's name servers.
For example, to switch to the first name server listed in Step 3, type server NS000.NS0.com. nslookup replies with a message that indicates the new default server:
> server ns000.ns0.com Default Server: ns000.ns0.com Address: 220.127.116.11 >
- Type your domain name again.
This time, nslookup responds by displaying the DNS information for your domain:
> lowewriter.com Server: ns000.ns0.com Address: 18.104.22.168 lowewriter.com primary name server = ns207.pair.com responsible mail addr = root.pair.com serial = 2001121009 refresh = 3600 (1 hour) retry = 300 (5 mins) expire = 604800 (7 days) default TTL = 3600 (1 hour) lowewriter.com nameserver = ns000.ns0.com lowewriter.com nameserver = ns207.pair.com lowewriter.com MX preference = 50, mail exchanger = sasi.pair.com lowewriter.com internet address = 22.214.171.124 >
- Type exit to leave the Nslookup program.
You return to a command prompt.
> exit C:\>
Locating the mail server for an e-mail address
If you're having trouble delivering mail to someone, you can use nslookup to determine the IP address of the user's mail server. Then, you can use the ping command to see whether you can contact the user's mail server. If not, you can use the tracert command to find out where the communication breaks down.
To find a user's mail server, start nslookup and enter the command set type=MX. Then, enter the domain portion of the user's e-mail address. For example, if the user's address is Doug@LoweWriter.com, enter LoweWriter.com. nslookup will display the MX (Mail eXchanger) information for the domain, like this:
C:\>nslookup Default Server: ns7.attbi.com Address: 126.96.36.199 > set type=mx > lowewriter.com Server: ns7.attbi.com Address: 188.8.131.52 lowewriter.com MX preference = 50, mail exchanger = sasi.pair.com lowewriter.com nameserver = ns000.ns0.com lowewriter.com nameserver = ns207.pair.com ns000.ns0.com internet address = 184.108.40.206 ns207.pair.com internet address = 220.127.116.11 >
Here, you can see that the name of the mail server for the LoweWriter.com domain is sasi.pair.com.
In this tutorial:
- TCP/IP Tools and Commands
- Using the arp Command
- Using the hostname Command
- Renewing an IP lease
- Using the nbtstat Command
- Using the netdiag Utility
- Using the netstat Command
- Using the nslookup Command
- Displaying DNS records
- Using the pathping Command
- Using the ping Command
- Using the route Command
- Using the tracert Command