-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update-systemd-resolved failing to update DNS settings in Ubuntu 18.04 #64
Comments
Routes get added. Search domain and DNS don't. |
Same here on Ubuntu 18.40 - 64 bit Regards |
I'm having the same problem on Ubuntu 18.04. The logs show that the script is running, but the nameserver and search domain don't get updated. Has anyone found the cause or a solution? |
@cwray, @frspin, and @adamshand, What is the output of your If the DNS queries are not working then that suggests either they're not getting added to |
Same issue here, just after updating Ubuntu. Maybe some new package broke the script?
So there seems to be somethin wrong... [edit] Attaching syslog:
|
@Jean85 based on your logs, Anyway, based on the source code for nm-openvpn-service-openvpn-helper there is support for for (i = 1; i < 256; i++) {
char *env_name;
env_name = g_strdup_printf ("foreign_option_%d", i);
tmp = getenv (env_name);
g_free (env_name);
if (!tmp || strlen (tmp) < 1)
break;
if (!g_str_has_prefix (tmp, "dhcp-option "))
continue;
tmp += 12; /* strlen ("dhcp-option ") */
if (g_str_has_prefix (tmp, "DNS "))
parse_addr_list (dns4_list, dns6_list, tmp + 4);
else if (g_str_has_prefix (tmp, "WINS "))
parse_addr_list (nbns_list, NULL, tmp + 5);
else if (g_str_has_prefix (tmp, "DOMAIN ") && is_domain_valid (tmp + 7))
g_ptr_array_add (dns_domains, tmp + 7);
} However, based on your logs, I see no sign of
I only see the only two
You should see these under Nonetheless, it certainly seems like NetworkManager is incompatible now with |
Thank you for your analysis. As reported before, |
@Jean85 no problem. It's been useful to explore your issue as I understand a little more what NetworkManager does (and doesn't) do. As of 3cef3f3 I've added a paragraph warning about it's use with NetworkManager. Until they fix their issues or make some better decisions, it's hard to see where we can both be interoperable. I'll leave this ticket open for the time being in case @cwray, @frspin, and @adamshand have anything different to add for their cases, or if other people are now experiencing the same problem. |
I've tried to use the CLI openvpn command, but it doesn't seem to work too; your script seems to be triggered correctly, and |
Hi @jonathanio, thanks for the response. I'm on a fairly vanilla Ubuntu 18.04 system, details you requested below. It's worth noting that this is a server and to the best of my knowledge I'm not running Network Manager (please excuse the uncertainty I'm an old sysadmin who is just recently getting used to all this "new fancy stuff" like systemd :-).
|
On the whole everything for you looks good - The script is loaded correctly (maybe add I think the main issue is - and I'm assuming that
and hopefully, on the next restart, it'll add those options into |
You are correct that this is on the client. I've added up-restart and fixed my dhcp-option lines as you suggest, and ... sure enough, that worked. Thanks heaps!
|
As a workaround for others who land here, I'm on ubuntu 18.04 and used to use update-systemd-resolved until entropy broke it one day. I found that NetworkManager itself has a way to prioritize VPN DNS, and seems to have the correct behavior without the update-systemd-resolved script. Modify your connection like so:
So your ipv4 section in your
Using this, I see:
Caveat: My use case is connecting to one VPN at a time, so this may not be for the general case. |
I was able to get this working by running a manual flush of DNS caches in systemd-resolve. Apparently config:
command: |
yes! |
In my case I didn't have to flush the cache. Adding the |
@servicecore-developer
Once dns cache has been flushed when starting vpn there's no reason to subsequently flush it on every restart. |
This script was working a few days ago for me. Had to rebuild my laptop and now it is not working.
Currently running ubuntu 18.04
It looks like it sets the DNS servers from the output. But actually does not add them.
Mon Mar 11 14:56:34 2019 /etc/openvpn/scripts/update-systemd-resolved tun0 1500 1572 172.30.0.6 172.30.0.5 init
<14>Mar 11 14:56:34 update-systemd-resolved: Link 'tun0' coming up
<14>Mar 11 14:56:34 update-systemd-resolved: Adding IPv4 DNS Server 10.248.16.1
<14>Mar 11 14:56:34 update-systemd-resolved: Adding IPv4 DNS Server 10.248.240.1
<14>Mar 11 14:56:34 update-systemd-resolved: Setting DNS Domain example.com
<14>Mar 11 14:56:34 update-systemd-resolved: SetLinkDNS(8 2 2 4 10 248 16 1 2 4 10 248 240 1)
<14>Mar 11 14:56:34 update-systemd-resolved: SetLinkDomains(8 1 example.com false)
Mon Mar 11 14:56:34 2019 /sbin/ip route add 10.248.240.0/20 via 172.30.0.5
Mon Mar 11 14:56:34 2019 /sbin/ip route add 10.248.32.0/20 via 172.30.0.5
Mon Mar 11 14:56:34 2019 /sbin/ip route add 10.248.16.0/20 via 172.30.0.5
Mon Mar 11 14:56:34 2019 /sbin/ip route add 10.248.0.0/20 via 172.30.0.5
Mon Mar 11 14:56:34 2019 /sbin/ip route add 172.30.0.1/32 via 172.30.0.5
The text was updated successfully, but these errors were encountered: