Click to See Complete Forum and Search --> : DNS cache


kiwipenguin
03-05-2003, 12:26 AM
Hi there

While installing Mandrake 9 on my machine I noticed a server under DNS that said it plugged into BIND and kept a local DNS cache for faster queries by dialup users. My problem is, I can't for the life of me remember the name of that package. Can anyone help me? Or should I not install Linux at 1am?

sclebo05
11-25-2003, 05:13 PM
ooooooooooh, exactly what i am looking for too, waiting for a reply to this thread. if i find a solution, i will post it here.

nextbillgates
11-26-2003, 05:07 AM
IPCop uses dnrd as a DNS cache. I'm not sure if that's what you're looking for or not.

Satanic Atheist
11-26-2003, 08:20 AM
You can manipulate the cache with rndc.

The caches is NOT written to disc. Ever. At least, not as far as I've ever found. It is always maintained in static memory, separate from BIND. If BIND dies and is restarted, it will pick up the cache that it had before (this causes problems if the cache becomes flooded with bad data) so I normally flush the cache every 24 hours (I am away from my machines like 75% of the time and need the DNS to stay up - hence the crontab entry).

When I had problems with my DNS cache corrupting, I had to reboot to sort it (I didn't know about rndc then) and restarting BIND didn't fix it.

James

jumpedintothefire
11-26-2003, 08:25 AM
On my RH machine the rpm is caching-nameserver-7.2-4, not sure if MDK has called it the same thing...

sclebo05
11-26-2003, 03:59 PM
hey jumped - i installed that package on my fedora machine - do i have to config anything or is it just 'working'? i never know with RH, if this were my slack box i would already be knee deep in config files :)

jumpedintothefire
11-26-2003, 07:25 PM
do a netstat -na look for something running on port 53. Ensure 127.0.0.1 is the only nameserver listed in /etc/resolv.conf. Check with nslookup, the server should be 127.0.0.1, something like:

[root@sarg3 jerry] nslookup justlinux.com
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.
Server: 127.0.0.1
Address: 127.0.0.1#53

Non-authoritative answer:
Name: justlinux.com
Address: 63.236.73.208

Hope it helps....

sclebo05
11-26-2003, 10:17 PM
hmmm, kinda works

i used a netstat -na | grep 53 and found many lines, so i am assuming that part is set up

the nameserver in resolv.conf is my router, NOT my machine here. when i changed it to my machine, i was not able to ping anything.

what did i set up wrong?

jumpedintothefire
11-27-2003, 12:04 AM
Maybe, but did the nslookup respond or did it fail to find the server?....
What does "nslookup localhost" give you?? Any firewall??
When you say ping you mean by name right? but by ip works? Just making sure the net work is still up... Guess you need to setup the nameserver... Don't ask for the gui directions, I don't use X on by boxes, just at home and I still hand editing the files.... Post the config files....

Satanic Atheist
11-27-2003, 12:44 PM
I've had the same problem - using the loopback device for DNS does not resolve names, only using the proper network address does. I have a strange suspicion that this is because it uses the same device (ethx or lo) to search the Internet for the root DNS servers.

Changing /etc/resolv.conf should not affect your ability to ping by IP address but it may affect your ability to ping by DNS name - as jumpedintothefire said above.

Try setting /etc/resolv.conf to your IP address and see what happens.

James

sclebo05
11-27-2003, 01:02 PM
nslookup failed to find server.

as i said in my above post, i tried setting my resolv.conf to my IP address.

maybe i am missing the fundamentals here. i just want to locally cache dns entries to facilitate faster surfing. no real reason, just wanna try it. ill try some more stuff in a bit. any tutorials or info page i should be reading? first time setting this stuff up (for curiousity's sake)

Satanic Atheist
11-27-2003, 02:27 PM
Sorry - missed that one.

Can you tell me:

1) What packages you have installed
2) What your config files are

All I needed was BIND9 which defaults to a caching Internet nameserver. Once installed, you only need to start it and it works out of the box.

I required my own internal DNS and (as I found out before) being able to resolve DNS names on my own is very handy.

James

jumpedintothefire
11-27-2003, 08:06 PM
[root@sarg3 jerry]# rpm -aq | grep bind
bind-utils-9.2.1-9
bind-9.2.1-9

What versions do you have??

do a "service named restart" and check /var/log/messages for something like:

Nov 26 21:42:04 sarg3 named[5349]: listening on IPv4 interface lo, 127.0.0.1#53
Nov 26 21:42:04 sarg3 named[5349]: listening on IPv4 interface eth1, 10.2.0.1#53
Nov 26 21:42:04 sarg3 named[5349]: command channel listening on 127.0.0.1#953
Nov 26 21:42:04 sarg3 named[5349]: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
Nov 26 21:42:04 sarg3 named[5349]: zone localhost/IN: loaded serial 42

Better yet, post the result... and the /etc/named.conf file..

Satanic Atheist:

Lo does work for me, but I stated the addresses to "listen on" in the named.conf file.. Maybe that is the difference.. I also state the
'forwarders' to use...

sclebo05
11-28-2003, 08:14 PM
[sclebo05@warbox sclebo05]$ rpm -aq | grep bind
bind-9.2.2.P3-9
ypbind-1.12-3
bind-utils-9.2.2.P3-9
redhat-config-bind-2.0.0-18]

yeah.....named definitely wasn't running. what a boob i am.
so i turned it on and changed the resolv.conf to point to my local machine, now
i can ping www.google.com for example. at this point, am i caching these dns
entries? what file do my dns entries get cached to? can i limit the size of the
files?

here is my named.conf, but all seems to be working, just want to know where
these entries are going

**********************named.conf for completeness*************************
// generated by named-bootconf.pl
options {
directory "/var/named";
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};

//
// a caching only nameserver config
//
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};

include "/etc/rndc.key";

Satanic Atheist
11-29-2003, 09:11 AM
The DNS cache is never written to disk. It's entirely held in memory.

Here is my named.conf as requested:
options {
directory "/var/named";
allow-recursion { 192.168.1.0/24; localhost; };
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};

//
// a caching only nameserver config

zone "." IN {
type hint;
file "named.ca";
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-query { 127.0.0.1; };
allow-update { 127.0.0.1; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-query { 127.0.0.1; };
allow-update { none; };
};

zone "home" IN {
type master;
file "db.home";
allow-query { 192.168.1.0/24; 127.0.0.1; };
allow-update { 192.168.1.0/24; };
};

zone "1.168.192-arpa" IN {
type master;
file "db.1.168.192";
allow-query { 192.168.1.0/24; 127.0.0.1; };
allow-update { 192.168.1.0/24; };
};
I'm running a small DNS server here so I can identify machines on the network via name.

James

sclebo05
11-29-2003, 07:01 PM
so there isn't a way to write them to disk? i power cycle this machine often :(