[TriLUG] Caching DNS (was Re: mozilla pause for ads)
Aaron S. Joyner
aaron at joyner.ws
Thu Jun 17 12:19:48 EDT 2004
Jeremy Portzer wrote:
>$ nslookup -sil
>
>
If you run this command with out the -sil command, you get this message:
> Note: nslookup is deprecated and may be removed from future releases.
> Consider using the `dig' or `host' programs instead. Run nslookup with
> the `-sil[ent]' option to prevent this message from appearing.
And with good reason. It's likely that in a release or two from now of
BIND, the command won't be there, so it's a good time to understand it's
replacement, "host". It's not any more difficult to use or understand
than nslookup (unlike dig), and for most things is actually a quicker
way of getting the information you need. I'll use your examples to
illustrate my point.
>>server 127.0.0.1
>>
>>
>Default server: 127.0.0.1
>Address: 127.0.0.1#53
>
>
>>www.trilug.org
>>
>>
>Server: 127.0.0.1
>Address: 127.0.0.1#53
>
>Non-authoritative answer:
>www.trilug.org canonical name = moya.trilug.org.
>Name: moya.trilug.org
>Address: 64.244.27.141
>
>
The host equivalent of all this nonsense? One very intuitive command:
> host www.trilug.org 127.0.0.1
This gives you back an almost identical response to the above nslookup
command. To say that nslookup has more features than host is simply
wrong. You can do everything with host that you can do with dig, it's
just that host returns more human-readable responses, that don't require
an advanced understanding of how DNS queries work (just like nslookup).
The reason that the BIND crew has moved away from nslookup, is that it's
unnecessary to have this intimidating command-shell driven resolver just
to look up a simple name, at a specified server. Just to clarify what's
possible with host vs nslookup, I'll provide a quick cheatsheat:
set q=any ... becomes ... host -t any <query>
set q=mx ... becomes ... host -t mx <query>
server 127.0.0.1 ... becomes ... host <query> 127.0.0.1
And once you've gotten the hang of host, you'll realise that it's almost
identical to dig's interface, except that dig requires an @ before
specifying a remote server name.
/hug Jeremy -- it's not that nslookup is bad for you, it's just that if
you're teaching someone something new, teaching them with the tool
that's been deprecated for at least 2 years is a bad idea. :)
On the flip side... nslookup is avaliable in a default windows install,
and it's unlikley that they'll change it there, so it's still useful to
understand how it works. But not in the context of how to setup a BIND
caching name server. :)
Aaron S. Joyner
More information about the TriLUG
mailing list