Bug 18279

Summary: Long running programs don't detect resolv.conf being updated when roaming
Product: glibc Reporter: Philip Prindeville <philipp>
Component: networkAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal CC: fweimer, kevin, philipp, siddhesh
Priority: P2 Flags: fweimer: security-
Version: 2.20   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Philip Prindeville 2015-04-18 19:14:29 UTC
Thanks to the stability of Linux, I run it on my laptop and leaving it running for weeks at a time. During that time, I might (a) have Thunderbird running and (b) roam from my home wired network on my docking station to a Wifi hotspot at an airport or Starbucks or hotel to the office wired network and back again.

Unfortunately, during this time, /etc/resolv.conf will get rewritten by dhclient multiple times, but the contents that were in it when Thunderbird (for example) originally started will long have become irrelevant.

A simple fix would be to either stat() /etc/resolv.conf or to have inotify() detect when /etc/resolv.conf has been written, deleted, or created and to re-run res_init() at that time.

It might be possible to configure /etc/resolv.conf to point to a local proxy which then is a little smarter about detecting network configuration changes, but most distros aren't going to do that: it's complexity that they don't want to deal with, and it complicates troubleshooting for the end-user.

Or you could tell users to shutdown and restart all of their applications because libresolv doesn't handle roaming, but I don't think that advice will be well received either.

We're living in the age of pervasive internet, and we roam constantly because we can.

Time for libresolv to get caught up to a 21st century paradigm. This isn't 1985 anymore.
Comment 1 Joseph Myers 2015-08-24 09:43:21 UTC
Duplicate.

*** This bug has been marked as a duplicate of bug 984 ***