Bug 20463

Summary: gethostbyname() caches the IP of the DNS server
Product: [Retired] Red Hat Linux Reporter: fnurgel <micke>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: ats, fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-04 00:53:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description fnurgel 2000-11-07 13:06:41 UTC
I have noticed this when running two gnome applets, gnomeicu and gweather.
I was also told that this happens with netscape and in that case it
problably happens everywhere.

If you start the applet (gnomeicu in this case) and connect to the server
and then shut down the network and plug in the computer to some other
network (with a different nameserver),
the applet cannot resolve any names anymore because the old nameserver ip
is cached somewhere.
You have to restart the applet to get it working again.

A bit bothersome when you are using a laptop in different locations.

Comment 1 Alan Shutko 2001-02-04 00:53:03 UTC
I've also seen this problem, for the same reason.  (Roaming laptop.)  This "bug"
has been there for at least a couple years, so I'm not sure it's technically a
bug.  (After all, I can't find anything that suggests that changing resolv.conf
will affect running programs.)

Regardless, the behavior is very annoying.  Only way I know offhand to rectify
this is to turn off pump's writes to resolv.conf and install a caching bind.  It
would be nice if this weren't necessary.

Comment 2 Jakub Jelinek 2001-02-04 07:46:55 UTC
This has been actually discussed on libc-hacker mailing list
and was decided that users can use nscd and thus there is no need
to add overhead of additional syscall per name resolution (some *stat
to check whether resolv.conf was updated).
So install nscd and whenever you make changes to resolv.conf,
simply /etc/init.d/nscd restart.