How to configure DNS nameservers on Ubuntu 18.04

On most Linux distributions you configure DNS nameservers in /etc/resolv.conf. However in recent versions of Ubuntu that changed with the introduction of Netplan. Netplan is configured by editing YAML files located in /etc/netplan/. The precise name of this file will depend on your system configuration. I’m using an Ubuntu droplet on Digital Ocean, and the file is called 50-cloud-init.yaml. Configure DNS nameservers Open the .yaml configuration file in /etc/netplan using your favourite text editor.
Read more...