1. Setup
2. Problem
There are no search domains configured in "/etc/resolv.conf" although "dnsmasq" sends them to the VM.
3. Logs
Extract from dnsmasq logs: This shows the options transferred from dnsmasq to the dhcp client (VM). I replaced all "internal" IP-addresses.
4. Configs
The configuration of resolved looks like this:
The network cloud-init configuration for the vm contains this:
This is the data netplan got via DHCP:
The generated .network-file for networkd looks like this:
5. Findings
If I modify the .network file manually and restart networkd + resolved, the /etc/resolv.conf contains the configured domains.
6. Question
What do I need to do to make proxmox/cloud-init/netplan generate the "correct" .network file?
- I use the PROXMOX 6 (proxmox-ve: 6.1-2)
- I set up a DNS server with dnsmasq
- dnsmasq is configured to send search-domains
- The VM is running Arch Linux
- Within the VM systemd-networkd and systemd-resolved are used
- I use "cloud-init" 19.3 with netplan 0.98-1
2. Problem
There are no search domains configured in "/etc/resolv.conf" although "dnsmasq" sends them to the VM.
Code:
# [...]
nameserver 10.0.0.2
3. Logs
Extract from dnsmasq logs: This shows the options transferred from dnsmasq to the dhcp client (VM). I replaced all "internal" IP-addresses.
Code:
option: 53 message-type 5
option: 54 server-identifier 10.0.0.3
option: 51 lease-time 12h
option: 58 T1 6h
option: 59 T2 10h30m
option: 1 netmask 255.255.255.0
option: 28 broadcast 10.0.0.255
option: 12 hostname server1
option: 42 ntp-server 213.239.239.166
option: 15 domain-name in.exmple.com
option:119 domain-search xxxxx
option: 6 dns-server 10.0.0.2
option: 3 router 10.0.0.1
4. Configs
The configuration of resolved looks like this:
Code:
resolvectl status
Code:
Link 2 (eth0)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
DefaultRoute setting: yes
LLMNR setting: yes
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: allow-downgrade
DNSSEC supported: yes
Current DNS Server: 10.0.0.2
DNS Servers: 10.0.0.2
The network cloud-init configuration for the vm contains this:
Code:
$ sudo qm cloudinit dump 1 network
Code:
version: 1
config:
- type: physical
name: eth0
mac_address: 'xxxxx'
subnets:
- type: dhcp4
- type: dhcp6
- type: nameserver
address:
- '10.0.0.2'
search:
- 'in.example.com'
This is the data netplan got via DHCP:
Code:
% sudo netplan ip leases eth0
Code:
# This is private data. Do not parse.
ADDRESS=10.0.0.3
NETMASK=255.255.255.0
ROUTER=10.0.0.1
SERVER_ADDRESS=10.0.0.2
NEXT_SERVER=10.0.0.2
BROADCAST=10.0.0.255
T1=21600
T2=37800
LIFETIME=43200
DNS=10.0.0.2
NTP=213.239.239.166
DOMAINNAME=in.example.com
DOMAIN_SEARCH_LIST=in.example.com
HOSTNAME=server1
CLIENTID=xxxxxx
The generated .network-file for networkd looks like this:
Code:
% cat /run/systemd/network/10-netplan-*.network
Code:
[Match]
MACAddress=xxxxxxx
Name=eth0
[Network]
DHCP=yes
LinkLocalAddressing=ipv6
[DHCP]
RouteMetric=100
UseMTU=true
5. Findings
If I modify the .network file manually and restart networkd + resolved, the /etc/resolv.conf contains the configured domains.
Code:
% cat /run/systemd/network/10-netplan-*.network
Code:
[Match]
MACAddress=xxxxxxx
Name=eth0
[Network]
##### MODIFICATION: BEGIN #########
UseDomains=yes
##### MODIFICATION: END #########
DHCP=yes
LinkLocalAddressing=ipv6
[DHCP]
RouteMetric=100
UseMTU=true
6. Question
What do I need to do to make proxmox/cloud-init/netplan generate the "correct" .network file?