How to setup static ip and static nameserver in ubuntu 18.04 LTS and 20.04 LTS remove netplan




Install packages for network and dns

$ apt install ifupdown resolvconf -y

remove cloud-init

$ apt remove cloud-init -y

delete netplan config

$ rm -rf /etc/netplan/*


$ reboot

$ vim /etc/network/interfaces

auto lo
iface lo inet loopback
auto ens3
iface ens3 inet static
address 192.168.1.154
netmask 255.255.252.0
gateway 192.168.1.1
dns-nameservers  192.168.1.30

$ vim /etc/resolvconf/resolv.conf.d/head

nameserver 8.8.8.8
nameserver 8.8.4.4

save and reboot

now check dns entries

$ cat /etc/resolv.conf

Comments

Popular posts from this blog

Running web ssh client on port 443 /80 with nginx as reverse proxy

Running cockpit behind nginx reverse proxy with nginx ssl and cockpit non ssl

Setup VOD streaming server with nginx using RTMP on Ubuntu 18.04