Hi.
Is there any way to prevent the gethostbyname() function not to read the nscd cache on Linux?
Thanks in advance!
Hi.
Is there any way to prevent the gethostbyname() function not to read the nscd cache on Linux?
Thanks in advance!
don't use nscd? :)
Seriously, if you're relying on gethostbyname()
you may want to use libresolv
and call res_gethostbyname()
instead.
Although that is considered a security flaw by djb at least :)
Consider using the djbdns client library. Very secure, fast, and solid.
Not really an answer, but use getaddrinfo(3)
instead :)
As far as nscd
is concerned, here's from the nscd.conf(5)
manual page:
enable-cache service <yes|no> Enables or disables the specified service cache.
You'll have to find out what the correct service
for DNS is.
I don't think gethostbyname really caches entries. It's most likely your dns-cache itself.