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]
  • 1
    You first have to make a decision to use NetworkManager or netplan. If you connect wi-fi to various wireless networks, then NetworkManager is probably the better choice. Netplan is best used in servers, where the configuration doesn't change much. See netplan.io/examples. – heynnema Dec 3 at 20:52
  • @heynnema is this NetworkManager? Or is it something else? Please see this image linuxconfig.org/images/… – stackinator Dec 3 at 21:01
  • 1
    That's NetworkManager. netplan has no GUI... only files in /etc/netplan, and the netplan CLI. However, if you're using NetworkManager, there's still one relevant .yaml file in /etc/netplan. – heynnema Dec 3 at 21:20
  • @heynnema and correct me if I'm wrong but I'll need to enable NetworkManager for 18.04 in my /etc/netplan file like this: network:\n [TAB]version: 2 [TAB]renderer: NetworkManager and then I run netplan generate && netplan apply. – stackinator Dec 3 at 21:55
  • 1
    That's correct. Indentation is important. See my answer, below, or the examples site that I quoted earlier. Use spaces, not tabs. – heynnema Dec 3 at 22:58
up vote 1 down vote accepted

You first have to make a decision to use NetworkManager or netplan. If you connect wi-fi to various wireless networks, then NetworkManager is probably the better choice. Netplan 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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.