named fails to listen dynamic ipv6 address on startup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bind9 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
On rebooting up ubuntu 20.04, named detects available ipv6 address assigned via router advertisement but fails to listen on it.
`journalctl -b0` shows something like this.
```
Jan 01 15:27:12 cdns named[200]: IPv6 socket API is incomplete; explicitly binding to each IPv6 address separately
Jan 01 15:27:12 cdns named[200]: listening on IPv6 interface lo, ::1#53
Jan 01 15:27:12 cdns named[200]: listening on IPv6 interface eth0, fd42:xxxxxxx#53
Jan 01 15:27:12 cdns named[200]: creating TCP socket: address not available
```
It seems named.service is starting up too early. I have tried adding `After=
I could reproduce this on LXD container ubuntu-daily:20.04 and current version
bind9/focal-
```
lxc launch ubuntu-daily:20.04 cdns
lxc exec cdns -- apt install -y bind9
lxc restart cdns
lxc exec cdns -- ss -tupln | grep :53
```
The final command should print that named listening on a unique local address generated by LXD.
```
tcp LISTEN 0 10 [fd42:xxxxxxxx]:53 [::]:*
```
A few users noticed this issue and posted workaround on askubuntu.
https:/
Their workaround, delaying service startup resolved this issue for me.
```
# systemctl edit named
[Service]
ExecStartPre=
```
FYI I've reported a similar (but different) bug: https:/ /bugs.launchpad .net/ubuntu/ +source/ bind9/+ bug/1965521
I believe the workaround that I've offered is slightly more optimal than the 10-second sleep offered above. (It is however reassuring to know that you solved this problem in almost exactly the same way.)
Thanks,
Nick.