[Gllug] Is my cheapo router really caching DNS?

Alistair Mann gllug at lgeezer.net
Sat Aug 30 21:33:59 UTC 2008


Adrian McMenamin wrote:
> Having read a quite good introduction to djbdns in the latest issue of
> Linux Journal I am tempted to set up a caching DNS server on my network,
> except that my router (a piece of cheap commodity kit) claims to be
> doing this already (see below). Is it really, or is it just redirecting
> these elsewhere and how can I tell?

I've seen a twelve-quid router use linux, so I've no problem thinking 
that it probably does cache. The simple way to tell is to use dig and 
some google-fu.

First visit altavista, or any search engine, and search on your name and 
this date. Note the domain name of the first returned entry. Your 
purpose here is to obtain an FQDN that is both valid and unlikely to 
have recently been visited. That way we can be fairly sure that it 
doesn't already exist in the cache, if the cache exists.

Assuming the router has indeed not looked for the above domain name, it 
will report nothing.

[am at localhost ~]$ dig +norecurse +short @192.168.0.1 mail.google.com
[am at localhost ~]$

Now force a lookup::

[am at localhost ~]$ ping -c 1 mail.google.com
[am at localhost ~]$

Now repeat the first dig

[am at localhost ~]$ dig +norecurse +short @192.168.0.1 mail.google.com
66.249.91.83
66.249.91.19
66.249.91.18
66.249.91.17
[am at localhost ~]$

We know that the router is caching then, because only the router was 
asked (use of '@'), it wasn't allowed to refer to anyone else (use of 
+norecurse) and it didn't know until forced to look it up. If it had 
nocache, it would have not had an answer at the second time of asking.

HTH,
-- 
Alistair Mann
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list