Ubuntu – 18.04 – does it force netplan or can I still use resolved.conf

18.04dnsnetplannetwork-managernetworking

I kept getting timeout errors on 18.04 Bionic Beaver, until I switched to OpenDNS using these commands

sudo rm -f /etc/resolv.conf 
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf 
sudo nano /etc/systemd/resolved.conf
# with body 
nameserver 208.67.222.222

Should I really be doing this OpenDNS configuration with Netplan? I tried the following but it doesn't work.

# Create a netplan file
sudo vi /etc/netplan/50-cloud-init.yaml

.

# Put this in the body
nameservers: 
    addresses: [208.67.222.222, 208.67.220.220]

I also tried this syntax in the body to no avail, but maybe it because I'm on wifi and I called out 'ethernet'??? wlo1 is my wifi logical name when I sudo lshw -C network.

network:
  ethernet:
    wlo1:
      nameservers:
        addresses: [208.67.222.222, 208.67.220.220]

Best Answer

  • You first have to make a decision to use NetworkManager or systemd-networkd. If you connect wi-fi to various wireless networks, then NetworkManager is probably the better choice. systemd-networkd is best used in servers, where the configuration doesn't change much. See https://netplan.io/examples.

    /etc/netplan .yaml example to enable NetworkManager...


    network:
      version: 2
      renderer: NetworkManager
    

    In terminal...

    sudo netplan --debug generate # generate config files

    sudo netplan apply # apply the new config

    reboot # reboot to confirm network operation

  • Related Question