I would like to use DHCP to assign an IP address to my server, but specify the DNS servers manually. I tried the following simple configuration:
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: yes
nameservers: [8.8.8.8,8.8.4.4]
After running netplan apply
I check the nameservers with systemd-resolve --status
and it shows:
DNS Servers: 8.8.8.8
8.8.4.4
192.168.1.1
The last is the DNS server provided by DHCP, which I do not want to be in the list.
Does netplan have a way to accomplish this?