Bug 63946 - nscd not restarted after changing /etc/resolv.conf
Summary: nscd not restarted after changing /etc/resolv.conf
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
(Show other bugs)
Version: 7.2
Hardware: i386 Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2002-04-22 14:59 UTC by diego.santacruz
Modified: 2014-03-17 02:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-04-20 16:11:02 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description diego.santacruz 2002-04-22 14:59:55 UTC
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):


How reproducible:

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.,
ping altavista.com)

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

Additional info:

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.

Comment 1 diego.santacruz 2002-06-19 14:48:23 UTC
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.

Comment 2 Bill Nottingham 2005-04-20 16:11:02 UTC
This is fixed in current RHEL3 update releases, RHEL 4, and FC2/FC3+.

Note You need to log in before you can comment on or make changes to this bug.