When I tried commenting out the nameserver lines in the /etc/resolv.conf the
database slowed down almost immediately. I was looking at the
/etc/nsswitch.conf file and see a reference to DNS on the host line. Is that
the only other file that needs to be changed?
Also if I change the resolv.conf and nsswitch.conf files will it work without a
reboot?
Thanks
Gary Quiring
Yes. You should just remove dns from nsswitch.conf, leave resolv.conf
alone. That way, any programs that use DNS directly (e.g. nslookup) will
still know what nameservers to use.
>Also if I change the resolv.conf and nsswitch.conf files will it work without a
>reboot?
Any network-related programs that are already running, like network
daemons, will probably have cached the information they got when they
started up. So you either need to restart all these daemons or reboot.
--
Barry Margolin, bar...@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
Yes
Delete or rename /etc/resolv.conf, and delete the "dns" in /etc/nsswitch.conf.
If your Informix server is still slow, it does direct resolver lookups.
>
> Also if I change the resolv.conf and nsswitch.conf files will it work without a
> reboot?
Yes.
--
Michael Tosch / Master IS/IT Support
Ericsson Eurolab Deutschland GmbH
Tel: +49 2407 575 313
>>Also if I change the resolv.conf and nsswitch.conf files will it work without a
>>reboot?
> Any network-related programs that are already running, like network
> daemons, will probably have cached the information they got when they
> started up. So you either need to restart all these daemons or
> reboot.
Any examples? Most daemons should be using the resolver libraries
(gethostbyname() and relatives). If so, they'll work fine without a
reboot.
I believe nscd even flushes the host cache on changes to nsswitch.conf.
--
Darren Dunham ddu...@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
sendmail
> Most daemons should be using the resolver libraries
>(gethostbyname() and relatives). If so, they'll work fine without a
>reboot.
No they won't. The resolver routines only read the configuration files the
first time they're used in a process. So any process whose lifetime
spanned the change to the files may not notice the changes.
> sendmail
>> Most daemons should be using the resolver libraries
>>(gethostbyname() and relatives). If so, they'll work fine without a
>>reboot.
> No they won't. The resolver routines only read the configuration files the
> first time they're used in a process. So any process whose lifetime
> spanned the change to the files may not notice the changes.
I don't think that's true.
Try this program. Run it, then take 'dns' out of your
/etc/nsswitch.conf file. Don't do anything else... You can use any
host you like, but it's most obvious to use a host via CNAME, so you can
see the different name returned.
#include <stdio.h>
#include <netdb.h>
main(){
struct hostent* name;
while(1){
sleep(3);
name = gethostbyname("smtp.google.com");
if (name == NULL) {
printf ("No answer\n");
continue;
}
printf ("Answer: %s\n", name->h_name);
}
}
gcc -lnsl name.c
$ ./a.out
Answer: smtp8.google.com
Answer: smtp8.google.com
No answer
No answer
No answer
No answer
No answer
No answer
Answer: smtp8.google.com
Answer: smtp8.google.com
^C
Are you running nscd? If so, the library doesn't read nsswitch.conf
directly, it lets nscd handle everything for it. And nscd, unlike the
resolver library, checks for nsswitch.conf changing while it's running.
Actually, I could be wrong about some of this. While I'm pretty sure that
changes to /etc/resolv.conf are not noticed by the resolver functions
(res_*), I'm less sure about whether /etc/nsswitch.conf changes are checked
for by the higher-level functions (get*by*).
>>Try this program. Run it, then take 'dns' out of your
>>/etc/nsswitch.conf file. Don't do anything else... You can use any
>>host you like, but it's most obvious to use a host via CNAME, so you can
>>see the different name returned.
> Are you running nscd? If so, the library doesn't read nsswitch.conf
> directly, it lets nscd handle everything for it. And nscd, unlike the
> resolver library, checks for nsswitch.conf changing while it's running.
*bing* right answer. I remembered the connection about nscd changing
behavior when nsswitch.conf is changed, but I didn't kill it when I did
my test.
It's behavior was the one changing.
So, you have to bounce all the daemons if you're not running nscd. I
generally just disable the hosts-cache rather than kill it entirely,
allowing me to misinterpret the behavior.