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

Teresa e Junior teresaejunior at gmail.com
Mon May 21 21:25:57 UTC 2018


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.




More information about the ubuntu-users mailing list