I am trying to set up Ubuntu 18.04 LTS, which appears to be using netplan to configure networking. In this case I need to override the DNS servers provided by DHCP and use manually assigned nameservers. So I modified the netplan configuration as follows:
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp2s1:
dhcp4: yes
dhcp4-overrides:
use-dns: false
dhcp6: yes
dhcp6-overrides:
use-dns: false
nameservers:
addresses: ["fd35:2ff0:b0b9:d0c0::1:1", 192.168.255.17]
In another question, and on netplan.io, it was explained that netplan had options dhcp4-overrides
and dhcp6-overrides
which would permit this, but these don't appear to work. netplan generate
or netplan apply
gives the error:
Error in network definition //etc/netplan/01-netcfg.yaml line 6 column 6: unknown key dhcp4-overrides
How, then, can I be sure that my specified nameservers will be used, and the nameservers obtained from DHCP will never be used? I'm willing to toss netplan in the bin if necessary.