I run OpenVPN on my laptop, and move between different physical
locations/networks without rebooting my laptop or restarting OpenVPN.
All I do is hibernate/unhibernate.

After unhibernate, OpenVPN correctly detects that its "connection" has
dropped, and attempts to re-initiate the connection. My config file uses
a DNS name for the "remote" option (since the server uses DHCP for its
IP, and the hostname is a dyndns hostname).

However, the DNS lookup never works if I've moved network locations,
since glibc caches the content of /etc/resolv.conf forever, and hence
OpenVPN (via glibc) continues to attempt to query the DNS servers from
the old physical location/network, which refuse to answer clients at the
new location/network, and connectivity may not even be available to such
an IP.

I believe the fix for this is for OpenVPN to call the "res_init()"
function whenever it attempts to restart a broken connection (or at
least periodically when doing this) or when DNS lookups fail. This
should flush the /etc/resolv.conf cache, pick up the new entries that
are relevant to the laptops' new location/network, and everything will
be happy.

For more (brief) details, see the following bug report:

http://sourceware.org/bugzilla/show_bug.cgi?id=3675

Reply via email to