systemd-resolve/NetworkManager changes (17.10 -> 18.04)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

systemd-resolve/NetworkManager changes (17.10 -> 18.04)

Teresa e Junior
Whenever I connect my laptop to a new network with NetworkManager, I
don't need to manually set the DNS servers if I configure
systemd-resolve with the following (in
/etc/systemd/network/wireless.network):

[Match]
Name=wl*

[DHCP]
UseDNS=false

[Network]
DNS=8.8.4.4 208.67.220.220

The problem is that this stopped working when I upgraded from Artful to
Bionic:

$ systemd-resolve --status | awk '/DNS Servers/,/^$/'
          DNS Servers: 189.4.0.242
                       189.4.0.153
                       189.4.0.234

But it works if I manually restart systemd-networkd and network-manager:

$ sudo systemctl restart systemd-networkd.service
$ sudo systemctl restart network-manager.service
$ systemd-resolve --status | awk '/DNS Servers/,/^$/'
          DNS Servers: 8.8.4.4
                       208.67.220.220

          DNS Servers: 8.8.4.4
                       208.67.220.220

How can I restore the old behaviour, or what is the preferred method now?

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd-resolve/NetworkManager changes (17.10 -> 18.04)

Liam Proven
On Sat, 19 May 2018 at 21:02, Teresa e Junior <[hidden email]>
wrote:

> How can I restore the old behaviour, or what is the preferred method now?

I had something similar last year. I think the steps here sorted it:

https://askubuntu.com/questions/965527/dns-problems-after-upgrading-from-16-04-to-17-10-how-to-reset-the-dns-settings


--
Liam Proven • Profile: https://about.me/liamproven
Email: [hidden email] • Google Mail/Hangouts/Plus: [hidden email]
Twitter/Facebook/Flickr: lproven • Skype/LinkedIn: liamproven
UK: +44 7939-087884 • ČR (+ WhatsApp/Telegram/Signal): +420 702 829 053

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd-resolve/NetworkManager changes (17.10 -> 18.04)

Teresa e Junior
In reply to this post by Teresa e Junior
Em 19/05/2018 15:59, Teresa e Junior escreveu:

> Whenever I connect my laptop to a new network with NetworkManager, I
> don't need to manually set the DNS servers if I configure
> systemd-resolve with the following (in
> /etc/systemd/network/wireless.network):
>
> [Match]
> Name=wl*
>
> [DHCP]
> UseDNS=false
>
> [Network]
> DNS=8.8.4.4 208.67.220.220
>
> The problem is that this stopped working when I upgraded from Artful to
> Bionic:
>
> $ systemd-resolve --status | awk '/DNS Servers/,/^$/'
>           DNS Servers: 189.4.0.242
>                        189.4.0.153
>                        189.4.0.234
>
> But it works if I manually restart systemd-networkd and network-manager:
>
> $ sudo systemctl restart systemd-networkd.service
> $ sudo systemctl restart network-manager.service
> $ systemd-resolve --status | awk '/DNS Servers/,/^$/'
>           DNS Servers: 8.8.4.4
>                        208.67.220.220
>
>           DNS Servers: 8.8.4.4
>                        208.67.220.220
>
> How can I restore the old behaviour, or what is the preferred method now?

The reason why restarting the services worked is that systemd-networkd
hadn't been started in the first place. Enabling systemd-networkd solved
the problem.

My main concern now is who disabled systemd-networkd in the last upgrade
and why. It is strange too that the serviced status returned "disabled;
vendor preset: enabled".

$ grep resolve /lib/systemd/system-preset/90-systemd.preset
enable systemd-resolved.service

I thought some postinst script disabled the service (I'm sure I didn't),
but that doesn't seem to be the case:

$ ack --shell systemd-resolved /var/lib/dpkg/info/
/var/lib/dpkg/info/systemd.postinst
44:    systemctl enable systemd-resolved.service || true
154:    _systemctl try-restart systemd-resolved.service || true

/var/lib/dpkg/info/libnss-resolve:amd64.postinst
41:    systemctl enable systemd-resolved.service
43:        deb-systemd-invoke start systemd-resolved.service || true

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd-resolve/NetworkManager changes (17.10 -> 18.04)

Teresa e Junior
In reply to this post by Liam Proven
Em 21/05/2018 06:26, Liam Proven escreveu:
> I had something similar last year. I think the steps here sorted it:
>
> https://askubuntu.com/questions/965527/dns-problems-after-upgrading-from-16-04-to-17-10-how-to-reset-the-dns-settings

Thank you! I tried those answers, except installing onbound, and none
worked. But now I have managed to solve the problem, although I don't
know what caused it (see my other email).

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd-resolve/NetworkManager changes (17.10 -> 18.04)

Teresa e Junior
In reply to this post by Teresa e Junior
Em 21/05/2018 16:03, Teresa e Junior escreveu:

> Em 19/05/2018 15:59, Teresa e Junior escreveu:
>> Whenever I connect my laptop to a new network with NetworkManager, I
>> don't need to manually set the DNS servers if I configure
>> systemd-resolve with the following (in
>> /etc/systemd/network/wireless.network):
>>
>> [Match]
>> Name=wl*
>>
>> [DHCP]
>> UseDNS=false
>>
>> [Network]
>> DNS=8.8.4.4 208.67.220.220
>>
>> The problem is that this stopped working when I upgraded from Artful
>> to Bionic:
>>
>> $ systemd-resolve --status | awk '/DNS Servers/,/^$/'
>>           DNS Servers: 189.4.0.242
>>                        189.4.0.153
>>                        189.4.0.234
>>
>> But it works if I manually restart systemd-networkd and network-manager:
>>
>> $ sudo systemctl restart systemd-networkd.service
>> $ sudo systemctl restart network-manager.service
>> $ systemd-resolve --status | awk '/DNS Servers/,/^$/'
>>           DNS Servers: 8.8.4.4
>>                        208.67.220.220
>>
>>           DNS Servers: 8.8.4.4
>>                        208.67.220.220
>>
>> How can I restore the old behaviour, or what is the preferred method now?
>
> The reason why restarting the services worked is that systemd-networkd
> hadn't been started in the first place. Enabling systemd-networkd solved
> the problem.
>
> My main concern now is who disabled systemd-networkd in the last upgrade
> and why. It is strange too that the serviced status returned "disabled;
> vendor preset: enabled".
>
> $ grep resolve /lib/systemd/system-preset/90-systemd.preset
> enable systemd-resolved.service
>
> I thought some postinst script disabled the service (I'm sure I didn't),
> but that doesn't seem to be the case:
>
> $ ack --shell systemd-resolved /var/lib/dpkg/info/
> /var/lib/dpkg/info/systemd.postinst
> 44:    systemctl enable systemd-resolved.service || true
> 154:    _systemctl try-restart systemd-resolved.service || true
>
> /var/lib/dpkg/info/libnss-resolve:amd64.postinst
> 41:    systemctl enable systemd-resolved.service
> 43:        deb-systemd-invoke start systemd-resolved.service || true

Nevermind, I decided to configure dhclient instead of systemd-networkd.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd-resolve/NetworkManager changes (17.10 -> 18.04)

Liam Proven
In reply to this post by Teresa e Junior
On Mon, 21 May 2018 at 21:05, Teresa e Junior <[hidden email]>
wrote:

> The reason why restarting the services worked is that systemd-networkd
> hadn't been started in the first place. Enabling systemd-networkd solved
> the problem.

> My main concern now is who disabled systemd-networkd in the last upgrade
> and why. It is strange too that the serviced status returned "disabled;
> vendor preset: enabled".

I'm glad you found an answer and please I assisted in some way.

I didn't probe too deeply when mine failed. I did a few tests, worked out
that both Ethernet and Wifi were connected and working, I could ping hosts
on the LAN and in the wider world, and that it was just DNS that was
failing. Then I googled how to fix that, and the 2nd suggestion (I think)
worked.

I blame systemd, but then, when almost anything goes wrong on a modern
Linux box, I blame systemd.

--
Liam Proven • Profile: https://about.me/liamproven
Email: [hidden email] • Google Mail/Hangouts/Plus: [hidden email]
Twitter/Facebook/Flickr: lproven • Skype/LinkedIn: liamproven
UK: +44 7939-087884 • ČR (+ WhatsApp/Telegram/Signal): +420 702 829 053

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd-resolve/NetworkManager changes (17.10 -> 18.04)

Teresa e Junior
Em 22/05/2018 06:17, Liam Proven escreveu:

> I'm glad you found an answer and please I assisted in some way.
>
> I didn't probe too deeply when mine failed. I did a few tests, worked out
> that both Ethernet and Wifi were connected and working, I could ping hosts
> on the LAN and in the wider world, and that it was just DNS that was
> failing. Then I googled how to fix that, and the 2nd suggestion (I think)
> worked.
>
> I blame systemd, but then, when almost anything goes wrong on a modern
> Linux box, I blame systemd.

In this particular case, I actually believe that NetworkManager is the
one to blame. One thing I noticed is that, although the systemd-networkd
service was disabled and its settings not loaded, systemd-networkd was
actually running, probably started by NetworkManager (just like NM used
to start an instance of dnsmasq in previous releases).

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd-resolve/NetworkManager changes (17.10 -> 18.04)

Tom H-4
In reply to this post by Teresa e Junior
On Sat, May 19, 2018 at 8:59 PM, Teresa e Junior
<[hidden email]> wrote:

>
> Whenever I connect my laptop to a new network with NetworkManager, I don't
> need to manually set the DNS servers if I configure systemd-resolve with the
> following (in /etc/systemd/network/wireless.network):
>
> [Match]
> Name=wl*
>
> [DHCP]
> UseDNS=false
>
> [Network]
> DNS=8.8.4.4 208.67.220.220
>
> The problem is that this stopped working when I upgraded from Artful to
> Bionic:
>
> $ systemd-resolve --status | awk '/DNS Servers/,/^$/'
>          DNS Servers: 189.4.0.242
>                       189.4.0.153
>                       189.4.0.234
>
> But it works if I manually restart systemd-networkd and network-manager:
>
> $ sudo systemctl restart systemd-networkd.service
> $ sudo systemctl restart network-manager.service
> $ systemd-resolve --status | awk '/DNS Servers/,/^$/'
>          DNS Servers: 8.8.4.4
>                       208.67.220.220
>
>          DNS Servers: 8.8.4.4
>                       208.67.220.220
>
> How can I restore the old behaviour, or what is the preferred method now?

What's "/etc/resolv.conf" pointing at?

What are the NM settings? ( "/etc/NetworkManager/NetworkManager.conf"
and "/etc/NetworkManager/conf.d/*" )

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: systemd-resolve/NetworkManager changes (17.10 -> 18.04)

Tom H-4
In reply to this post by Liam Proven
On Mon, May 21, 2018 at 11:26 AM, Liam Proven <[hidden email]> wrote:
> On Sat, 19 May 2018 at 21:02, Teresa e Junior <[hidden email]>
> wrote:
>>
>> How can I restore the old behaviour, or what is the preferred method now?
>
> I had something similar last year. I think the steps here sorted it:
>
> https://askubuntu.com/questions/965527/dns-problems-after-upgrading-from-16-04-to-17-10-how-to-reset-the-dns-settings

Regarding the unbound solution:

1) Replacing the resolved stub resolver with the unbound caching
resolver's a relatively big change.

2) I'd add a check to the target of the "/etc/resolv.conf" to the
procedure; or I'd simply turn it into a one-line regular file (
"nameserver 127.0.0.1" ).

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users