Comment 1 for bug 226185

Revision history for this message
Thierry Carrez (ttx) wrote :

Thanks for your bug report.

update-resolv-conf uses /sbin/resolvconf (if installed) -a and -d options to handle the update of the /etc/resolv.conf file. If you have resolvconf installed, the /etc/resolv.conf file should no longer be edited by hand, otherwise your changes will be lost at next update : resolvconf doesn't backup/restore configurations, it builds resolv.conf dynamically.

Try :
$ cp /etc/resolv.conf my_backup_resolv.conf
$ echo nameserver 10.0.0.1 | sudo /sbin/resolvconf -a eth0
$ cat /etc/resolv.conf

$ echo nameserver 192.168.0.1 | sudo /sbin/resolvconf -a eth1
$ cat /etc/resolv.conf

$ sudo /sbin/resolvconf -d eth1
$ cat /etc/resolv.conf
$ sudo mv my_backup_resolv.conf /etc/resolv.conf

You can see that if the original configuration of the /etc/resolv.conf file was created by resolvconf, everything works ok.

So you should decide if you want to use resolvconf to handle your /etc/resolv.conf file : if yes, you should provide the original configuration using /sbin/resolvconf -a to make sure it will not be overwritten by update-resolv-conf. If not, you should create scripts to backup/restore your resolv.conf file and use them (instead of update-resolv-conf) in your openvpn config files.

AFAICT the behavior you're experiencing is the way resolvconf is designed to work. I'll close this bug as invalid, please feel free to reopen it if you think I did not properly understand.