When my laptop (Debian 11/testing) wakes up from suspend, I can’t resolve names of my running containers for a while.
If I send a request to dnsmasq directly, e.g.
dig @10.20.42.1 mx1.test
the name is not found.
The problem seems to be:
cat /var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.leases
-> contains only:
duid 00:01:00:01:27:b7:06:de:f0:de:f1:8c:21:dd
If I wait for some minutes(?), and check again, then the leases file is filled again:
cat /var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.leases
->
1615723760 00:16:3e:c8:f6:c0 10.20.42.208 mx1 ff:3e:c8:f6:c0:00:01:00:01:27:d5:ec:5c:00:16:3e:c8:f6:c0
duid 00:01:00:01:27:b7:06:de:f0:de:f1:8c:21:dd
And name resolution works again.
Unfortunately, it’s not easy to reproduce. In preparation of this post, I’ve suspended my laptop. And after wake up, the file still contains the lease.
I’d like to speed up that process, so how can I refresh /var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.leases ?
Next time it happens, I’ll try
systemctl reload snap.lxd.daemon.service
or
lxc exec mx1 -- dhclient -sf /bin/true eth0
as a workaround.
Any hints towards a solution?
Ingo