incus 6.23 here. I have an issue where a container with a dynamic lease has a resolvable name under the “.incus” domain, but a static one doesn’t. I’m probably not understanding the full set of conditions required for a container name to be resolvable.
Here’s the network:
nsrc@brian-kit:~$ incus network show wifi0
config:
bridge.external_interfaces: eno1
ipv4.address: 100.126.0.1/22
ipv4.dhcp.ranges: 100.126.1.0-100.126.3.254
ipv4.nat: "true"
ipv6.address: XXXX:XXX:XX:XXfc::1/64
ipv6.dhcp.ranges: XXXX:XXX:XX:XXfc::1000-XXXX:XXX:XX:XXfc::1fff
ipv6.dhcp.stateful: "true"
ipv6.nat: "false"
raw.dnsmasq: address=/local.nsrc.org/100.126.0.1
description: ""
name: wifi0
type: bridge
used_by:
- /1.0/instances/temp123
- /1.0/instances/unifi
- /1.0/profiles/wifi0
managed: true
status: Created
locations:
- none
project: default
There is no dns.mode configured - documentation says it should default to “managed”, and the default domain is “incus”.
On this network are two containers. unifi is a previously created container with static netplan configuration inside it, but I’ve also configured a static lease for it (outside of the DHCP pool):
nsrc@brian-kit:~$ incus config show unifi
...
devices:
eth0:
ipv4.address: 100.126.0.234
name: eth0
nictype: bridged
parent: wifi0
type: nic
temp123 is just incus launch images:ubuntu/24.04/cloud temp123 -p wifi0 so it has a dynamic lease.
The problem is that the containers cannot resolve unifi.incus, even though they can both resolve temp123.incus
nsrc@brian-kit:~$ incus exec -- temp123 ping -4 -c1 unifi.incus
ping: unifi.incus: Name or service not known
nsrc@brian-kit:~$ incus exec -- temp123 ping -4 -c1 temp123.incus
PING temp123.incus (100.126.2.110) 56(84) bytes of data.
64 bytes from temp123.incus (100.126.2.110): icmp_seq=1 ttl=64 time=0.024 ms
...
nsrc@brian-kit:~$ incus exec -- unifi ping -4 -c1 unifi.incus
ping: unifi.incus: Name or service not known
nsrc@brian-kit:~$ incus exec -- unifi ping -4 -c1 temp123.incus
PING temp123.incus (100.126.2.110) 56(84) bytes of data.
64 bytes from temp123.incus (100.126.2.110): icmp_seq=1 ttl=64 time=0.048 ms
...
nsrc@brian-kit:~$ dig @100.126.0.1 unifi.incus. | egrep -A1 'status:|ANSWER SECTION'
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 39778
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
nsrc@brian-kit:~$ dig @100.126.0.1 temp123.incus. | egrep -A1 'status:|ANSWER SECTION'
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7762
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
--
;; ANSWER SECTION:
temp123.incus. 0 IN A 100.126.2.110
Both containers are running, and the leases for both are visible:
nsrc@brian-kit:~$ incus network list-leases wifi0
+----------+-------------------+------------------------+---------+
| HOSTNAME | MAC ADDRESS | IP ADDRESS | TYPE |
+----------+-------------------+------------------------+---------+
| * | | XXXX:XXX:XX:XXfc::13b8 | DYNAMIC |
+----------+-------------------+------------------------+---------+
| temp123 | 10:66:6a:82:ac:d7 | 100.126.2.110 | DYNAMIC |
+----------+-------------------+------------------------+---------+
| temp123 | | XXXX:XXX:XX:XXfc::18ff | DYNAMIC |
+----------+-------------------+------------------------+---------+
| unifi | 10:66:6a:49:c6:51 | 100.126.0.234 | STATIC |
+----------+-------------------+------------------------+---------+
| wifi0.gw | | XXXX:XXX:XX:XXfc::1 | GATEWAY |
+----------+-------------------+------------------------+---------+
| wifi0.gw | | 100.126.0.1 | GATEWAY |
+----------+-------------------+------------------------+---------+
The dnsmasq command which incus spawns is:
dnsmasq --keep-in-foreground --strict-order --bind-interfaces --except-interface=lo \
--pid-file= --no-ping --interface=wifi0 --dhcp-rapid-commit --no-negcache \
--quiet-dhcp --quiet-dhcp6 --quiet-ra --listen-address=100.126.0.1 --dhcp-no-override \
--dhcp-authoritative --dhcp-leasefile=/var/lib/incus/networks/wifi0/dnsmasq.leases \
--dhcp-hostsfile=/var/lib/incus/networks/wifi0/dnsmasq.hosts \
--dhcp-range 100.126.1.0,100.126.3.254,1h \
--listen-address=XXXX:XXX:XX:XXfc::1 --enable-ra \
--dhcp-range XXXX:XXX:XX:XXfc::1000,XXXX:XXX:XX:XXfc::1fff,64,1h \
--dhcp-option-force=option6:dns-server,[XXXX:XXX:XX:XXfc::1] \
-s incus --interface-name _gateway.incus,wifi0 -S /incus/ \
--conf-file=/var/lib/incus/networks/wifi0/dnsmasq.raw -u incus -g incus
There are hosts files for both:
nsrc@brian-kit:~$ ls /var/lib/incus/networks/wifi0/dnsmasq.hosts
temp123.eth0 unifi.eth0
nsrc@brian-kit:~$ head -100 /var/lib/incus/networks/wifi0/dnsmasq.hosts/*
==> /var/lib/incus/networks/wifi0/dnsmasq.hosts/temp123.eth0 <==
10:66:6a:82:ac:d7,temp123
==> /var/lib/incus/networks/wifi0/dnsmasq.hosts/unifi.eth0 <==
10:66:6a:49:c6:51,100.126.0.234,unifi
I’m scratching my head now. Any clues as to why this isn’t resolvable?