[PLUG] Working around borked nameservers, clearing caches

Keith Lofstrom keithl at kl-ic.com
Mon Mar 12 15:59:43 UTC 2007


> On 3/11/07, Keith Lofstrom <keithl at kl-ic.com> wrote:
...
> >laptop on the VPN link.  That meant that new names resolved
> >correctly, but the old addresses still pointed at the
> >borked IP addresses given by the balky nameserver; the bad
> >translations were apparently cached somewhere.
>
> >My experience with nameservers is with named and such;  I
> >recently changed over to 2.6.9/RHEL4.4 and don't know where
> >the name service cache sits, or how to flush it (it seems
> >to survive through a reboot).  So the question:
> >
> >??? How do you flush the namserver cache on 2.6.9/RHEL4.4 ?
...

[ In summary, I was at a motel with a borked dns server.  I
tried modifying /etc/resolv.conf by hand to some good servers,
but was still getting bad IP addresses for names looked up
previously.  I assume a cache contains persistent bad IP
addresses - keith ]


On Mon, Mar 12, 2007 at 01:52:55AM -0700, drew wymore wrote:
> rndc flush
> 
> that will flush all the cache

That is an accurate answer, but I think I mistakenly asked the
wrong question.  I don't have rndc or named on my laptop.  Those
were on RH9 2.4.22, but not on RHEL4.4 2.6.9.  I have the nscd
(name service cache daemon) program on my laptop, but "nscd -g"
says nscd is not running. 

I am not sure, but I think I am trying to find the "DNS resolver"
cache for my 2.6.9 kernel, see:
    http://en.wikipedia.org/wiki/DNS#Broken_resolvers

Since both ping and firefox were giving me the bad IP addresses,
it is probably something the kernel hooks up to, though since it
persists through reboots it is probably a cache outside of the
kernel itself.  "man resolver" (and gethostbyname),  doesn't tell
me about cache files.  I've looked at much other stuff, and may
have to dive into kernel source to answer the question.  Yikes!

I have SELINUX enabled, if that makes any difference, I don't 
understand SELINUX (we need a PLUG presentation).  Perhaps that
doesn't work with a hand-edited /etc/resolv.conf file unless I
take extra steps.  When I look at sbin/dhclient-script, for
example, I see "/sbin/restorecon /etc/resolv.conf" after that
script modifies /etc/resolv.conf .   Is this important?

So, the modified question:

??? How do you flush the dns resolver cache on 2.6.9/RHEL4.4
??? with SELINUX enabled?

Keith

-- 
Keith Lofstrom          keithl at keithl.com         Voice (503)-520-1993
KLIC --- Keith Lofstrom Integrated Circuits --- "Your Ideas in Silicon"
Design Contracting in Bipolar and CMOS - Analog, Digital, and Scan ICs



More information about the PLUG mailing list