TIL
Ubuntu 26 in Incus container does not apply the DHCP search domain by default. Search domain is also known as “DHCP Option 119”.
With Ubuntu 24 and earlier this was fine.
This is a regression that nobody seem to have noticed. Or everybody worked around it.
Let me show you the problem.
$ incus launch images:ubuntu/resolute/cloud u26 --network eno1
Launching u26
$ incus exec u26 -- hostname -f
u26
$ incus exec u26 -- hostname -A
u26.example.com
Next, get rid of that silly 127.0.1.1.
$ incus exec u26 -- sed -i '/127.0.1.1/d' /etc/hosts
$ incus exec u26 -- hostname -f
u26
Look at the resolvectl output
$ incus exec u26 -- resolvectl
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Link 26 (eth0)
Current Scopes: DNS
Protocols: +DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 172.16.16.1
DNS Servers: 172.16.16.1
Default Route: yes
Hmm. There’s no domain search. But my DHCP does provide it.
Ubuntu Incus cloud containers use netplan. We can instruct netplan to apply DHCP domain search.
root@u26:~# hostname -f
u26
root@u26:~# vi /etc/netplan/50-cloud-init.yaml
root@u26:~# cat /etc/netplan/50-cloud-init.yaml
network:
version: 2
ethernets:
eth0:
dhcp4: true
dhcp4-overrides:
use-domains: true
root@u26:~# netplan apply
root@u26:~# hostname -f
u26.example.com
Hurray, we’ve got a FQDN now
resolvectl shows it too
$ incus exec u26 -- resolvectl
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Link 26 (eth0)
Current Scopes: DNS
Protocols: +DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 172.16.16.1
DNS Servers: 172.16.16.1
DNS Domain: example.com
Default Route: yes