Bind9 conflict?

I installed bind9 to cache DNS, now containers start without network
lxc ls
±------±--------±-----±-----±-----------±----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
±------±--------±-----±-----±-----------±----------+
| u18-1 | RUNNING | | | PERSISTENT | 2 |
±------±--------±-----±-----±-----------±----------+
| u18-2 | RUNNING | | | PERSISTENT | 1 |
±------±--------±-----±-----±-----------±----------+

netstat -lnp | grep ":53 "
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      11503/named         
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      1388/systemd-resolv 
udp        0      0 127.0.0.1:53            0.0.0.0:*                           11503/named         
udp        0      0 127.0.0.53:53           0.0.0.0:*                           1388/systemd-resolv 

How can I resolve it? I need bind9.

Hi!

Most likely bind9 is also listening to the lxdbr0 network interface. When that happens, LXD’s dnsmasq cannot work and you lose DHCP services as well.

It is default for bind9 to listen to all network interfaces. Limit it not to listen to lxdbr0. There are several posts in this forum on how to do that.

1 Like

Please look at the lists above. I changed already bind conf to listen on 127.0.0.1 only, but it didn’t help.

Let’s get some more information.

It appears that you already have DNS caching (by systemd, in 18.04 or newer) so you wouldn’t need an additional DNS cache. Run the following to verify,

systemd-resolve --statistics

Also, if LXD is unable to spawn its own dnsmasq, it should complain in /var/snap/lxd/common/lxd/logs/lxd.log. Can you verify that you are seeing such an issue there?

In my case:

journalctl -u lxd
... dnsmasq[4180]: failed to create listening socket for <ipv6-address>%lxdbr0: Address already in use

so now I have to learn about IPv6 and how to configure bind9 to not use that addresses. :frowning:

You need to configure Bind9 not to use the lxdbr0 interface. That is easy to do.