General

howto check if DNS sever caches queries correctly ?

 
SOLVED
Go to solution
'chris'
Super Advisor

howto check if DNS sever caches queries correctly ?

hi

howto check if DNS sever caches queries correctly ?
I've installed an internal DNS server BIND 9 on Debian.

under options I have forwarders of my ISP:

options {
directory "/var/cache/bind";

forwarders { 211.12.X.X; 211.12.X.X; 194.15.X.X; };

forward first;

.....................................................................................................


howto be sure, that caches all queries
and doesn't go each time to the internet to ask DNS servers of my ISP ?

kind regards
chris
17 REPLIES 17
Kodjo Agbenu
Honored Contributor

Re: howto check if DNS sever caches queries correctly ?

Hello Chris,

Quite straightforward :
* nslookup or dig
* unplug the network cable
* nslookup or dig

You may also try a "soft" method by using tcpdump or ethereal as a spy for outgoing network traffic (monitor port 53, TCP and UDP).

Good lcuk.
Kodjo
Learn and explain...
'chris'
Super Advisor

Re: howto check if DNS sever caches queries correctly ?

thanks,

I've tried and this is working,
but I cannot find any Bind cache files.

/var/cache/bind is always empty.

where is Bind putting its cache files ?

greetings
chris
Stuart Browne
Honored Contributor
Solution

Re: howto check if DNS sever caches queries correctly ?

It's in memory.
One long-haired git at your service...
Karsten Breivik_1
Frequent Advisor

Re: howto check if DNS sever caches queries correctly ?

Interesting thread. At my work I have discovered that the DSN servers may in some cases return different answers depending on if your client computer is logged on to the domain or not. We are using MS based DNS servers and I have not bothered to look into why this is happening. I am sure The Sysadmin in all his wisdom propably have a perfectly good explanation for this. However, it is useful to be aware that this behavior can happen.

poi
Stuart Browne
Honored Contributor

Re: howto check if DNS sever caches queries correctly ?

Windows PC's also have local caching of DNS names. Unfortunately, it frequently also caches failed lookups, and doesn't honor TTL's nicely.

If you get weird results like that, you can flush the DNS cache using the command 'ipconfig /flushdns' (on the windows box).

anyway ;)
One long-haired git at your service...
'chris'
Super Advisor

Re: howto check if DNS sever caches queries correctly ?

@Stuart Browne

"It's in memory"

You mean RAM Memory ?
Stuart Browne
Honored Contributor

Re: howto check if DNS sever caches queries correctly ?

In the proces memory space, yea. As in a 'ps' will show how much memory it is using.
One long-haired git at your service...
Bejoy C Alias
Respected Contributor

Re: howto check if DNS sever caches queries correctly ?

Dear Cris,
The dns cache is in ur ram memory . When u restart ur dns server all the cache is lost . Bind is not storing any dns cache in files . U cant modify the amount of memory bind uses to allocate for the cache , bind allocates the memory depending on ur total memory . U can check whether the query is resolved from the cache or from the isp server by using the steps from Kodgo or u can see the query time it takes to check whether it is resolving from cache or ur isp server. Pls see the attachment and see the query time difference.
Be Always Joy ......
Schmid Marco
New Member

Re: howto check if DNS sever caches queries correctly ?

i understand why the cache is held in ram, but how to deal with the following situation:

in a large scale structure the dns cache helps to avoid
a lot of unnescessary querys for the same domain. but if someone moves a server from one ip to another and i have to update the cache entrys just for that specific host what would be the best method ???

remember, i dont want to loose the whole cache with a restart