LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   DNS losing cache (http://www.linuxquestions.org/questions/linux-networking-3/dns-losing-cache-205525/)

vasillalov 07-15-2004 05:00 PM

DNS losing cache
 
Hi all,
I am running the latest version of bind for Fedora Core 2.
The DNS server is authoritive for 2 domains. Everything is working fine with this part. Host resolutions and reverse DNS works excellent.

However, my DNS server keeps losing its cache. I also have it running as a caching DNS. What is really aggravating is the fact that I loose the DNS cache over couple of hours, which is rediculous....

How do I make my DNS preserve the cached information for longer?

Thanks for your input!

maxut 07-16-2004 02:17 AM

as i know u cant do anything about cache time. cache time is assinged by the out nameserver of that domain.


[root@teknik root]# cat /var/named/localhost.zone
....
....
1D IN NS @
1D IN A 127.0.0.1

1D means 1 day. this record can live in other nameserver's cache for 1 day.

maxut 07-16-2004 02:21 AM

hmmm. u can use your ISP namserver. u can forward dns queries to your ISP nameserver. so your nameserver wont search anything, also it still can cache.

read the man of named.conf and the keyword is forward .

i hope i would help u

vasillalov 07-16-2004 10:32 AM

Nono,
fellas, I am not talking about the domain cache that I am hosting.
I have an authoritative DNS for couple of domains BUT this works fine.

The same machine is also a caching DNS server for my local LAN. So I have told each computer to consult with my internal DNS when resolving domain names. That way I should not wait for my ISP name server to respond.

So lets say I type in www.google.com in my laptop's Mozilla. First time the response will very slow as my DNS needs to discover the actual IP address. The second time I type www.google.com it is instantaneous as my DNS has cached the IP that I am requesting.

My problem is that my DNS looses its cache and has to rediscover or relearn the IP address of google or any other site almost 4-5 times a day!

And this is not only on one of the computers but on all 5 machines that I have at home. I have told each machine on the LAN to consult with my DNS for name resolution!

Hope that clears it little bit!

maxut 07-17-2004 02:32 AM

i think i couldnt explain about forwarding clearly.
your clients will use your nameserver. but your nameserver wont resolve ip of domains. but i will keep caching them.

forward first ;
forwarders { ISP_nameserver_ip };

if your nameserver wont know the ip. it will ask your ISP nameserver to learn the ip. so it wouldnt search ip itself. so performans can be increased.
i dont know how to change the cache time. cos the zone files decide this time. for example www.google.com .. your nameserver find and asks google.com's nameserver about records. it also learns how long www.google.com record will live in your nameserver cache. u cant decide how long www.goole.com record can live in cache. cache time is assinged by zone files.

vasillalov 07-17-2004 09:15 AM

Quote:

Originally posted by maxut
i think i couldnt explain about forwarding clearly.
your clients will use your nameserver. but your nameserver wont resolve ip of domains. but i will keep caching them.

forward first ;
forwarders { ISP_nameserver_ip };

if your nameserver wont know the ip. it will ask your ISP nameserver to learn the ip. so it wouldnt search ip itself. so performans can be increased.
i dont know how to change the cache time. cos the zone files decide this time. for example www.google.com .. your nameserver find and asks google.com's nameserver about records. it also learns how long www.google.com record will live in your nameserver cache. u cant decide how long www.goole.com record can live in cache. cache time is assinged by zone files.

I seriously doubt that this is the case with my problem! My caching DNS was working fine until I added a new zone. I am thinking that it has sth to do with the serials in each zone...

Anyway, obviously more reading is required on my end.

tgridley 12-27-2007 04:33 PM

Any Luck With This
 
Have you or anyone else had any luck with this issue. I have the exact same problem except I am running Bind 9.2.3-5. DNS keeps loosing its cache. Please help.

JimBass 12-27-2007 05:16 PM

You get exactly the same answer Vasillalov gets above. You do not have the capability of how long you cache answers for, that is set by the authoritative DNS for each and every zone on the internet.

Google and yahoo for example, only give out answers for 300 seconds at a time. That is 5 minutes. If the last time any computer on your LAN asked for the address of google was more than 5 minute ago, your caching server will have to traverse the entire DNS tree down to the roots, then up to the google DNS, then on again to yourself. And from a DNS perspective, a.google.com is one lookup, and b.google.com is another.

Peace,
JimBass


All times are GMT -5. The time now is 01:49 AM.