DNS settings not changed for openvpn if resolvconf installed

Bug #107564 reported by Matthew Williams
32
This bug affects 3 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: network-manager

The patch package "network-manager-openvpn_0.3.2svn2342-0ubuntu3.diff.gz" contains 05-debian_backend.patch which in turn contains the following diff lines:

@@ -679,7 +734,10 @@
  */
 gboolean nm_system_should_modify_resolv_conf (void)
 {
- return TRUE;
+ if (g_find_program_in_path(RESOLVCONF) != NULL)
+ return FALSE;
+ else
+ return TRUE;
 }

This means that if the resolvconf package is installed, then network_manager does not do it's internal magic as it is expecting resolvconf to look after the changes. However, if an openvpn connection is being managed by network_manager, then the DNS settings being pushed by the server are effectively ignored if resolvconf is installed as there are not resolvconf specific hooks for the openvpn stuff.

I am not sure which package I should file this against. I chose network_manager as it is the above patch that prevents network_manager from "manually" modifying DNS entries. However, this could also be a problem with network-manager-openvpn not correctly spawning resolvconf if installed. It seems that network-manager is assuming resolvconf looks after all DNS stuff while the network-manager-openvpn is not leveraging resolvconf, so nothing gets done.

By the way, if resolvconf is not installed, then this all functions as expected and the openvpn DNS settings are correctly pushed to the client and /etc/resolv.conf is updated.

Revision history for this message
Matthew Williams (number6) wrote :

Looking further into the code, it looks like all VPN clients that can pass along nameserver information will suffer from this problem.

In src/vpn-manager/nm-vpn-service.c, the function nm_vpn_service_stage4_ip_config_get parses the dbus message that contains the DNS information. It calls nm_vpn_connection_set_config which eventually calls nm_system_should_modify_resolv_conf. Normally, it seems that network-manager assumes that dhclient, for example, looks after updating /etc/resolv.conf if resolvconf is installed. There is no accounting for the case where a vpn client wishes to set DNS information and resolvconf is installed.

I am not sure of the cleanest way to fix this problem. There is currently no way to indicate to to network-manager that it is responsible for setting DNS settings, even if resolvconf is installed. It would be nice for a parameter to be added to the "config" data that indicates that network-manager should call resolvconf if the parameter is set and if resolvconf is installed. In other words, there should be three possibilities:

1. resolvconf is not installed, always modify /etc/resolv.conf manually
2. resolvconf is installed and another element, like dhclient, will look after calling resolvconf
3. resolvconf is installed and network-manager must call resolvconf OR modify /etc/resolv.conf manually.

It is case 3 that is currently not handled.

Revision history for this message
TomasHnyk (sup) wrote :

Is this related to openvpn's (or linux's) problems with pulling dns settings? http://openvpn.net/howto.html#dhcp

Revision history for this message
Matthew Williams (number6) wrote :

No, the DNS settings are received correctly by OpenVPN. It's NetworkManager's handling of these settings that fails if resolvconf is installed.

Revision history for this message
Simon Law (sfllaw) wrote :

I suspect that the correct thing for NetworkManager to do is:

IF server pushed dns info THEN
  IF resolvconf is in path THEN system(echo nameserver $NAMESERVER | resolvconf -a $INTERFACE)
  ELSE modify resolv.conf itself

Revision history for this message
Alexander Sack (asac) wrote :

Can you pleaes verify if this issue is still in latest network-manager (0.6.5-0ubuntu15) in gutsy?

Thanks,
 - Alexander

Changed in network-manager:
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Matthew Williams (number6) wrote :

Yes. The problem still exists in the latest gutsy.

Revision history for this message
Nick Moffitt (nick-moffitt) wrote :

I can verify that it exists in the gutsy release.

Revision history for this message
Fernando Carolo (carolo) wrote :

I can confirm that it exists in the latest network-manager on gutsy, version 0.6.5-0ubuntu16.7.10.0.

Revision history for this message
Ryan Novosielski (novosirj) wrote :

Also in 0.6.6-0ubuntu5.

This is part of Ubuntu Hoary.

Is there any downside to removing resolvconf? If I'm only using NetworkManager for networking, and it can make the changes, then I'm basically happy?

Revision history for this message
Sean Sosik-Hamor (sciri) wrote :

I can also confirm that network-manager-openvpn is not properly pushing DNS entries to resolvconf as of this morning's Hardy snapshot.

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.04
DISTRIB_CODENAME=hardy
DISTRIB_DESCRIPTION="Ubuntu hardy (development branch)"

network-manager 0.6.6-0ubuntu5
network-manager-openvpn 0.3.2svn2342-1ubuntu4
resolvconf 1.38ubuntu1

Apr 11 11:35:41 baka NetworkManager: <info> VPN Activation (XXX VPN) Stage 4 of 4 (IP Config Get) reply received.
Apr 11 11:35:41 baka nm-openvpn[9209]: Initialization Sequence Completed
Apr 11 11:35:42 baka NetworkManager: <info> DHCP returned name servers but system has disabled dynamic modification!
Apr 11 11:35:42 baka NetworkManager: <info> VPN Activation (XXX VPN) Stage 4 of 4 (IP Config Get) complete.
Apr 11 11:35:42 baka NetworkManager: <info> VPN Activation (XXX VPN) successful.
Apr 11 11:35:42 baka NetworkManager: <info> VPN service 'org.freedesktop.NetworkManager.openvpn' signaled state change 3 -> 4.

Revision history for this message
Jeremy Wilkins (wjeremy) wrote :

Thank you for the resolvconf suggestion. NetworkManager is now pulling the DNS on this machine again. However I have a problem with KNetworkManager not starting at all. No messages and no logs.

Revision history for this message
Nukeador (nukeador) wrote :

I'm still having problems, I'm unable to change my DNS from network-manager. This should be a high priority bug.

network-manager 0.6.6-0ubuntu5

Revision history for this message
Nukeador (nukeador) wrote :
Revision history for this message
Alexander Sack (asac) wrote :

finally, NM 0.7 in intrepid should play nicely with resolvconf. Have fun. Thanks!

Changed in network-manager:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.