How to clear name cache on sun solaris?

Chip Old fold at bcpl.net
Fri Mar 30 15:07:59 UTC 2001


On Fri, 30 Mar 2001, Waltner, Steve wrote to bind-users at isc.org:

> The man page says "nscd -i hosts" will do it, but I've never gotten
> that to work on my Solaris 2.6 systems. One time, it appeared that a
> "touch /etc/hosts" on the system cleared the cache, but that didn't
> seem to do it now, so I think it was just coincidence. The sure fire
> way is "/etc/init.d/nscd stop; /etc/init.d/nscd start" which will stop
> and start the name caching daemon.

Actually the man page says "nscd -i hosts" will invalidate the hosts cache
- whatever that means.  I used to assume it cleared the cache until I
discovered that it didn't.  AFAIK "/etc/init.d/nscd stop; /etc/init.d/nscd
start" is the only way to do it.

Do you really need nscd's hosts cache?  I've seen anecdotal evidence that
on a machine running named, nscd slows down DNS lookups.  I don't know if
that's true or not, but I've disabled the hosts cache on my Solaris 2.6
machines.  To do so, add an "enable-cache hosts no" line to
/etc/nscd.conf.  In the stock /etc/nscd.conf that line is included but
commented out.  Uncomment it.

If you can do without nscd's caching of the results of lookups in the
passwd and group databases too (most systems can), disable nscd completely
by moving or renaming its startup script (probably /etc/rc2.d/S76nscd on a
standard Solaris 2.6 installation).

-- 
Chip Old (Francis E. Old)               E-Mail:  fold at bcpl.net
Manager, BCPL Network Services          Voice:   410-887-6180
Manager, BCPL.NET Internet Services     FAX:     410-887-2091
320 York Road
Towson, Maryland 21204 U.S.A.



More information about the bind-users mailing list