Things to try to speed up DNS resolution:
- Install and have the nscd service running
- Have the router serve the home LAN with DNS requests
1: nscd (Name service cache daemon)
Do all this while logged in as root. First, check to see that it is installed:
Code:
# rpm -q nscd
nscd-2.3.4-2.fc3 // Ok, nscd is installed
If it isn't, we have to install it:
Code:
# yum -y install nscd
And let yum do it's thing... Then we make sure it starts when you boot Fedora Core 3 the next time
Code:
# chkconfig nscd on
...and start it up so it runs now:
Code:
# service nscd start
That should improve things
2: DSL router as DNS cache
This may very well be different from router to router. I'm assuming you have the router setup to act as a DHCP server and Fedora and WinXP grabs its adress that way. Some routers might even send out a "correct" list of DNS server adresses with the router's own adress at the top. This then leads to the /etc/resolv.conf be as we want it. If not, read on...
My router, a Netgear FR114P, works fine as a DNS proxy/cache but doesn't seem deliver that info to LAN computers via DHCP. Instead, it serves out whatever ISP DNS:es it gets on the WAN interface (xDSL side). Therefore, I have to do a wee trick to have my Fedora machine use it as a DNS service.
2a: Does the router work as a DNS cache?
Let's do a short test to figure out if the router does work as a DNS proxy. My router is on 192.168.0.1, so I used this to force nslookup to ask the router:
Code:
# nslookup www.fedoraforum.org 192.168.0.1
Server: 192.168.0.1
Address: 192.168.0.1#53
Non-authoritative answer:
Name: fedoraforum.org
Address: 67.15.84.69
Yep, works splendidly.
2b: Do the DHCP replies from the router reflect that?
Check your /etc/resolv.conf. Here's an example of how it might look
Code:
# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver xxx.xxx.xxx.21
nameserver xxx.xxx.xxx.22
nameserver xxx.xxx.xxx.23
search localdomain
As you can see, the router's IP# isn't there (192.168.0.1 in my case). If your /etc/resolv.conf automatically gets the router's IP#, stop reading and be happy.
Me, I had to find a way to have that added there while still adapting to any ISP changes my router forwarded. The trick was to create a new file, /etc/dhclient.conf, with the following content:
Code:
prepend domain-name-servers 192.168.0.1;
That way, every time my computer boots, it gets it's IP address from the router along with other vital network properties, including a list of the DNS server my ISP offers. The first nameserver entry of /etc/resolv.conf will now be 192.168.0.1. That way, DNS lookups will ask that server first if it isn't already cached in memory by nscd (assuming I've understood how that works, anyhow ).
On my machine this means that name resolution is first handled by nscd, then the router and as a last resort my ISP's name servers.
3) Alternative: Using bind as a caching nameserver running locally on the machine
Assume your router can't be made to work as a DNS cache/proxy. Then, as hinted in a reply above, one can set up a DNS server as a cache. Luckily, in Fedora, there's a ready-made RPM package for just that use - caching-nameserver. I have that one installed on my machine but I'm not using it at the moment.
Check if caching-nameserver is installed:
Code:
# rpm -q caching-nameserver
caching-nameserver-7.3-3
If it isn't installed, and you'd like to try it, issue
Code:
# yum -y install caching-nameserver
Since it depends on a few other packages, they might be installed too (the bind name server service being one)
First, make sure the local bind server is used first for DNS requests:
/etc/dhclient.conf:
Code:
prepend domain-name-servers 127.0.0.1;
Start it up
Code:
# chkconfig named on
# service named start
And that should do it...
To make the changes take effect, you can always reboot. But since this isn't toy trash like Win9x/Me, we do it the proper way:
Code:
# ifdown eth0; ifup eth0
or, if that doesn't do it
Code:
# service network restart
I'm using the first alternative above, nscd + router as DNS proxy. It works a treat. I hope that some of this will help you analyse your problem and perhaps solve it.
Good luck!
EDIT: The service to run in #3 is "named", not "bind". (Mixed them up since the RPM package that installs named is called bind). Fixed. Thanks for the heads-up, awdac