Bug 20463 - gethostbyname() caches the IP of the DNS server
Summary: gethostbyname() caches the IP of the DNS server
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-11-07 13:06 UTC by fnurgel
Modified: 2016-11-24 14:48 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-02-04 00:53:06 UTC
Embargoed:


Attachments (Terms of Use)

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.


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