dnsmasq not working with OpenVPN
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dnsmasq (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
openvpn-systemd-resolved (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I'm using OpenVPN configured with Network Manager. My VPN have a DNS server configured by OpenVPN and config pushed by it while connecting. This server is not registered by dnsmasq so domain names are not resolved but pinging by IP address works. When I test name resolving by pointing to DNS server (172.16.1.1) from VPN provider it's works. For example:
$ host google.com 172.16.1.1
Using domain server:
Name: 172.16.1.1
Address: 172.16.1.1#53
Aliases:
google.com has address 172.217.0.174
google.com has IPv6 address 2607:f8b0:
google.com mail is handled by 30 alt2.aspmx.
google.com mail is handled by 20 alt1.aspmx.
google.com mail is handled by 40 alt3.aspmx.
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.
But if I test without pointing DNS server is not working:
$ host google.com
;; connection timed out; no servers could be reached
My /etc/resolv.conf:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
To repair this bug I have to kill dnsmasq and it's automatically reloaded.
I can confirm this problem. Since updating to 16.10 DNS fails when openvpn connection is enabled in NetworkManager. Intranet DNS lookups do not work - so the corporate servers cannot be reached. Additionally all my traffic is routed through the VPN and all external internet traffic is blocked.
A partial fix is to disable dnsmasq in /etc/NetworkMan ager/NetworkMan ager.conf
[main] ifupdown, keyfile, ofono
plugins=
#dns=dnsmasq
[ifupdown]
managed=false
And to restart NM with: sudo service network-manager restart
After this external traffic works again - but intranet hosts are still not resolvable - so I have to add manual settings in /etc/hosts for the intranet.
In 16.04 openvpn with pushed DNS worked perfectly - the openvpn server has not been changed and is still working fine for other clients.