Red Hat Bugzilla – Bug 63946
nscd not restarted after changing /etc/resolv.conf
Last modified: 2014-03-16 22:27:12 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.0 (X11; Linux i686; U;) Gecko/20020326
Description of problem:
/etc/sysconfig/network-scripts/ifup-post will change /etc/resolv.conf according
to the autotected DNS servers. However, the nscd service is not restarted and
thus the old DNS servers are still used while doing lookups.
Current behaviour is really misleading, since all hostname lookups fail without
any apparanet explanation to the user.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. service nscd start
2. connect a network device that autoconfigures DNS (e.g., ppp)
3. after connection is up attempt to access some existing network name (e.g.,
Actual Results: All name lookups fail, since nscd tries to reach invalid DNS
Expected Results: nscd is made aware of the changed /etc/resolv.conf
adding a call like
service nscd condrestart > /dev/null 2>&1
in /etc/sysconfig/network-scripts/ifup-post when /etc/resolv.conf is modified
should solve the problem.
Maybe something along the lines of
# If the resolver settings where adjusted after nscd started, restart to make
# it take into account the new DNS servers.
if [ -f /var/lock/subsys/nscd -a /etc/resolv.conf -nt /var/lock/subsys/nscd ]; then
# Make nscd aware of new name resolver settings
[ -x /etc/init.d/nscd ] && /etc/init.d/nscd condrestart
to add in ifup-post would be a good fix. I have these lines above (with an extra
workaround for bug #64603) in /sbin/ifup-local and it works like a charm.
This is fixed in current RHEL3 update releases, RHEL 4, and FC2/FC3+.