Skip to content

DNS service starting before network service is online? #2091

Description

@hwwilliams

Technitium DNS service has the following

After=network.target
Wants=network-online.target

Wants is a soft requirement, if it fails DNS still starts but even if it's just not done yet DNS doesn't wait for it either which can result in failure to bind addresses that may not be assigned to interfaces yet.

I had an issue recently where my 3 DNS servers lost power and when they came up all appeared to be fine locally as I could reach the internet and use DNS but when remote services tried to reach the DNS server it got connection refused messages.

I had configured the following setting

Image

I've since changed this to 0.0.0.0:53 and [::]:53 because I don't actually need it to be bound to .2 specifically but when it was bound and the network didn't come up quickly enough Technitium failed to bind because the address wasn't available yet

[2026-08-10 23:25:13 UTC] DNS Server is loading block list zone...
[2026-08-10 23:25:13 UTC] DNS Server is reading block list from: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
[2026-08-10 23:25:14 UTC] [192.168.1.2:53] [UDP] DNS Server failed to bind.
Cannot assign requested address
[2026-08-10 23:25:14 UTC] [192.168.1.2:538] [UDPPROXY] DNS Server failed to bind.
Cannot assign requested address
[2026-08-10 23:25:14 UTC] [192.168.1.2:53] [TCP] DNS Server failed to bind.
Cannot assign requested address
[2026-08-10 23:25:14 UTC] [192.168.1.2:538] [TCPPROXY] DNS Server failed to bind.
Cannot assign requested address
[2026-08-10 23:25:14 UTC] [[::]:53] [UDP] DNS Server was bound successfully.
[2026-08-10 23:25:14 UTC] [[::]:538] [UDPPROXY] DNS Server was bound successfully.
[2026-08-10 23:25:14 UTC] [[::]:53] [TCP] DNS Server was bound successfully.
[2026-08-10 23:25:14 UTC] [[::]:538] [TCPPROXY] DNS Server was bound successfully.

A reboot of the server did fix the issue at the time.

I think the corrected service settings would be

Wants=network-online.target
After=network-online.target

I can't see a situation where DNS would be useful before the network is online but let me know if this is something I'll have to add into my own installation process to avoid in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions