Netplan
Commands
Issue: Value search is empty in /etc/resolve.conf, but DHCP server provide it
systemd-netpland #cloud-init
State
Debian 12
/etc/resolve.conf
managed systemd-resolved
Network config managed Netplan by: cloud-init -> netplan -> networkd
# cat /etc/netplan/50-cloud-init.yaml | grep -vE '^#|^&'
network:
version: 2
ethernets:
eth0:
dhcp4: true
match:
macaddress: bc:24:11:07:c6:38
set-name: eth0
DHCP server has option for search
with value pve.loc
, but on host this value is empty:
Solution 1
Disable Netplan config management by cloud-init:
Add dhcp4-overrides:
values to /etc/netplan/50-cloud-init.yaml
network:
version: 2
ethernets:
eth0:
dhcp4: true
match:
macaddress: bc:24:11:07:c6:38
set-name: eth0
dhcp4-overrides:
use-dns: true
use-domains: true
Apply:
- reboot
- sudo neplan apply
Networkd will implement these changes to interface configuration:
# cat /run/systemd/network/10-netplan-eth0.network
[Match]
PermanentMACAddress=bc:24:11:07:c6:38
Name=eth0
[Network]
DHCP=ipv4
LinkLocalAddressing=ipv6
[DHCP]
RouteMetric=100
UseMTU=true
UseDomains=true
Result :