Switching Servers
Sometimes you want to query another name server directly—for example, if you think it is misbehaving. You can switch servers with nslookup by using the server or lserver commands. The difference between server and lserver is that lserver queries your “local” server—the one you started out with—to get the address of the server you want to switch to; server uses the default server instead of the local server. This difference is important because the server that you just switched to may not be responding, as we’ll show in this example:
C:\> nslookup
Default Server: relay.hp.com
Address: 15.255.152.2When we start up, our first server, relay.hp.com, becomes our lserver (this will matter later on in this session):
>server galt.cs.purdue.edu.Default Server: galt.cs.purdue.edu Address: 128.10.2.39 >cs.purdue.edu.Server: galt.cs.purdue.edu Address: 128.10.2.39 *** galt.cs.purdue.edu can't find cs.purdue.edu: No response from server
At this point we try to switch back to our original name server. But there is no name server running on galt to look up relay’s address:
> server relay.hp.com.
*** Can't find address for server relay.hp.com: No response from serverInstead of being stuck, though, we use the lserver command to have our local server look up relay’s address:
> lserver relay.hp.com.
Default Server: relay.hp.com
Address: 15.255.152.2
>Since the server on galt did not respond—it’s not even running a name server—it wasn’t possible to look up the address of relay ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access