Bug 20463 - gethostbyname() caches the IP of the DNS server
gethostbyname() caches the IP of the DNS server
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2000-11-07 08:06 EST by fnurgel
Modified: 2016-11-24 09:48 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-02-03 19:53:06 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description fnurgel 2000-11-07 08:06:41 EST
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-03 19:53:03 EST
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 02:46:55 EST
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.

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