DNS settings on Ubuntu 18.04

Ubuntu 18.04 is using systemd-resolved, see man resolved.conf for more information.

vi /etc/systemd/resolved.conf
[Resolve]
# Space separated list of IPv4 and IPv6 addresses
DNS=127.0.0.1
service systemd-resolved restart

resolv.conf is a symlink to ../run/systemd/resolve/stub-resolv.conf

See also: Nameservereinstellungen Ubuntu Server 22.04