named fails to listen dynamic ipv6 address on startup

Bug #1909822 reported by Ko-Zu
18
This bug affects 2 people
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=network-online.target` for named.service but nothing changed.

I could reproduce this on LXD container ubuntu-daily:20.04 and current version
bind9/focal-updates,now 1:9.16.1-0ubuntu2.4 amd64 [installed]

```
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://askubuntu.com/questions/1261187/dns-server-does-not-listen-on-ipv6-after-a-reboot

Their workaround, delaying service startup resolved this issue for me.

```
# systemctl edit named
[Service]
ExecStartPre=-/bin/sleep 10
```

Revision history for this message
Nick Tait (nick.t) wrote :

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.

Revision history for this message
Paride Legovini (paride) wrote :

Thanks Ko-Zu for reporting this bug and sorry if we didn't reply earlier, it somehow fell under the radar of our bug triage process

I agree with Nick in that this bug and LP: #1965521 are likely to have the same underlying issue: named is started before networking is ready.

As LP: #1965521 already elaborates more on the issue I'm tempted to mark this bug as a duplicate of it, but before doing I'd like to hear Ko-Zu's opinion, so I'm just marking this as Incomplete for now.

Changed in bind9 (Ubuntu):
status: New → Incomplete
Revision history for this message
Simon Déziel (sdeziel) wrote (last edit ):

FYI, this problematic behavior is fixed in Jammy/bind9 (I tested with 1:9.18.0-2ubuntu2) where the automatic-interface-scan feature works properly and detects IPs appearing/disappearing.

Revision history for this message
Paride Legovini (paride) wrote :

Thanks Simon for checking and clarifying! I'm marking the devel task as Fix Released then, and adding a Confirmed Focal task to reflect your IRC comment:

<sdeziel> paride: I can also confirm that Focal's broken and there, neither automatic-interface-scan nor interface-interval paper over the problem... bind9 simply never notices late showing IPs

We'll tackle LP: #1965521 on its own.

Changed in bind9 (Ubuntu Focal):
status: New → Confirmed
Changed in bind9 (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.