SCIENTIFIC-LINUX-USERS Archives

December 2005

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jon Peatfield <[log in to unmask]>
Reply To:
Jon Peatfield <[log in to unmask]>
Date:
Fri, 30 Dec 2005 16:32:58 +0000
Content-Type:
TEXT/PLAIN
Parts/Attachments:
TEXT/PLAIN (41 lines)
On Thu, 29 Dec 2005, Luke Scharf wrote:

> I've run into this problem before: how do I empty the DNS cache in Linux?
>
> I've changed a record in my DNS server, and ping still insists that the
> server is at the old address.   However, if I point nslookup directly at
> any/all of the DNS servers, I get the correct (new) address.
>
> I've tried touch'ing /etc/resolv.conf and /etc/nsswitch.conf.  I've
> poked around in /var looking for the file that the DNS client uses to
> store the database.  It has to be a file, because the last time I ran
> into this problem, a reboot wouldn't encourage ping or any of the other
> tools I tried to actually query the server and get the new record...
>
> Any suggestions?

I know of only 2 caches which might be relevant, nscd (as mentioned 
before), and a caching named.  You can flush the nscd hosts table by 
running (obviously as root):

   nscd --invalidate=hosts

you can see if there are things cached in there by running:

   nscd --statistic

The other is if you are running a local (cache-only) named, but you would 
know that from the resolv.conf entries (e.g. a 127.0.0.1 or similar 
nameserver entry).

If there is one you can cause it to reload/restart to flush the cache.

I'm assuming that you don't have any other sources of hostnames defined in 
nsswitch.conf ...

On this host what does host/dig say for the DNS name you changed?

-- 
Jon Peatfield,  Computer Officer,  DAMTP,  University of Cambridge
Mail:  [log in to unmask]     Web:  http://www.damtp.cam.ac.uk/

ATOM RSS1 RSS2