Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
And old thread, but without an answer for us desktop users who are looking for this information and are not running domain name servers on the desktop...
Does anyone have an answer for non-DNServer machines?
Distribution: SuSE, Knoppix, Ubuntu, FreeBSD, SCO Open Server
Posts: 7
Rep:
Of _course_ you may be caching dns even if you are running a "desktop" install.
There are several things that may be caching, any of several full dns servers, any of several local caching-only servers, and of course your upstream dns server probably caches to the limit allowed/specified in the ttl setting fo rthe particular record being looked up.
The most common caching daemon on linux these days (yes, running on "desktop" insalls) is nscd.
To clear it's cache takes 3 things:
stop the daemon, ensure the persistent option for the hosts service isn't enabled in nscd.conf or manualy wipe the persistent db, start the daemon.
How you stop & start the daemon, where nscd.conf is found, where the persistent db file is found, all depend on your particular distribution, but a generic answer that works on _most_ distributions is:
/etc/init.d/nscd stop
Verify /etc/nscd.conf has this:
persistent hosts no
shared hosts yes
/etc/init.d/nscd start
Or just stop the daemon and leave it stopped and don't worry about any config options or db files.
It will come back up at next reboot.
Sometimes even though the above works, there may also be a more convenient command.
Example, on SuSE, the above works, but there is also:
rcnscd stop
rcnscd start
This may not make much difference or help you though. DNS records have a TTL (time to live) field which specifies how long a nameserver may cache this particular record locally. Most nameservers cache all records for as long as TTL allows. So, your upstream dns server (whatever is listed in /etc/resolv.conf) and it's upstream dns server, and so on... all the way to whatever dns server is the authoritative nameserver for the record being fetched, will all most likely be caching that record for however long the TTL is for that record. Every record has it's own TTL value. A common TTL is 1800, which is 30 minutes, but in special cases like dyndns.org, they set very short TTL's on their records by default because they know the IPs will change often, because that is the whole point of dyndns.org in the first place. Also, since 2004-09-15 nscd already honors the TTL the same as all the other nameservers do. This means nscd will already perform a new lookup instead of supplying a record from cache no sooner than, and just as soon as, all the upstream dns servers.
So, for 2 different reasons, there is generally no point in clearing your local cache, it generally won't make a lick of difference.
I know this is a very old post, however, for those of you looking for an answer, here it is.
If you are running a workstation install of any Linux and your machine is caching DNS entries while NOT running bind, rscd or nscd; then the easiest way to clear that cache is to bounce the interface.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.