Define a hostname
vi /etc/hostname # short name is fine hostname HOSTNAME # idem vi /etc/hosts # long name FOLLOWED BY short name
Switch back to the old school /etc/network/interfaces
(unless you prefer netplan)
apt update apt install net-tools ifupdown rmdir /etc/network/interfaces.d/ #mv /etc/network/interfaces.d/50-cloud-init.cfg /etc/network/interfaces.fuck.the.cloud-init.cfg mv /etc/network/interfaces /etc/network/interfaces.dist
and proceed with a typical Debian network setup
vi /etc/network/interfaces auto lo iface lo inet loopback auto eth0 iface eth0 inet static address x.x.x.x/xx gateway x.x.x.x dns-nameservers 62.210.16.6 62.210.16.7 # dns-nameservers 208.67.222.222 208.67.220.220 # dns-search example.local
Apply, check that your local and caching stub-resolver points to your true validating resolver
systemctl restart networking ifconfig systemd-resolve --status
and see next section for disabling netplan at boot time
Eventually disable UFW
ufw disable
and if you really need to enable system firewalling see Netfilter
systemctl list-unit-files | grep resolv
older releases
systemctl status resolvconf systemctl stop resolvconf systemctl disable resolvconf
seen on artful debian9/stretch bionic
systemctl status systemd-resolved systemctl stop systemd-resolved systemctl disable systemd-resolved
more shit seen on a bionic dedibox
systemctl stop bind9 systemctl disable bind9 systemctl status bind9-resolvconf
ls -lF /etc/resolv.conf* mv /etc/resolv.conf /etc/resolv.conf.dist vi /etc/resolv.conf nameserver 208.67.222.222 nameserver 208.67.222.220 #search example.local
In case you get,
RTNETLINK answers: File exists
while restarting networking
, look at the logs and proceed against the relevant interface,
ip addr flush dev NETIF
How to install Ubuntu 17.10 (Artful Aardvark) Minimal Server - Page 2 https://www.howtoforge.com/tutorial/ubuntu-minimal-server-install/2/
Comment 7 for bug 548885 https://bugs.launchpad.net/ubuntu/+source/ntp/+bug/548885/comments/7 –> no symlink for resolv.conf
How to make Ubuntu server 18.04 use dns-nameservers from /etc/network/interfaces? https://askubuntu.com/questions/1080230/how-to-make-ubuntu-server-18-04-use-dns-nameservers-from-etc-network-interfaces