Port of CustomDNSAddress is lost when added to /etc/resolv.conf #2362

Open
opened 2025-11-20 07:08:34 -05:00 by saavagebueno · 3 comments
Owner

Originally created by @ZnqbuZ on GitHub (Oct 10, 2025).

I'm using netbird in docker v0.59.5. When CustomDNSAddress is in config.json netbird adds it to /etc/resolv.conf, but without the port.

For example, if "CustomDNSAddress": "0.0.0.0:5053", is in config.json my resolv.conf ends up like

/ # cat /etc/resolv.conf
# Generated by NetBird
# The original file can be restored from /etc/resolv.conf.original.netbird

options edns0 trust-ad
search netbird.cloud .
nameserver 0.0.0.0

In a docker container this only prevents netbird from reconnecting, but I suppose that it could break the Internet on a real system.

Originally created by @ZnqbuZ on GitHub (Oct 10, 2025). I'm using netbird in docker v0.59.5. When CustomDNSAddress is in config.json netbird adds it to /etc/resolv.conf, **but without the port**. For example, if `"CustomDNSAddress": "0.0.0.0:5053",` is in config.json my resolv.conf ends up like ``` / # cat /etc/resolv.conf # Generated by NetBird # The original file can be restored from /etc/resolv.conf.original.netbird options edns0 trust-ad search netbird.cloud . nameserver 0.0.0.0 ``` In a docker container this only prevents netbird from reconnecting, but I suppose that it could break the Internet on a real system.
saavagebueno added the triage-needed label 2025-11-20 07:08:34 -05:00
Author
Owner

@wehagy commented on GitHub (Oct 11, 2025):

AFAIK, resolv.conf doesn't support custom ports.

@wehagy commented on GitHub (Oct 11, 2025): AFAIK, `resolv.conf` doesn't support custom ports.
Author
Owner

@ZnqbuZ commented on GitHub (Oct 11, 2025):

AFAIK, resolv.conf doesn't support custom ports.

The point is netbird should not add an unusable nameserver to it

@ZnqbuZ commented on GitHub (Oct 11, 2025): > AFAIK, `resolv.conf` doesn't support custom ports. The point is netbird should not add an unusable nameserver to it
Author
Owner

@wehagy commented on GitHub (Oct 11, 2025):

Makes sense. If I remember correctly, this behavior is logged, but if it's not supported it's better not to touch resolv.conf.

If you don't want netbird to change resolv.conf but still want to use the netbird DNS server, set "DisableDNS" to true.

@wehagy commented on GitHub (Oct 11, 2025): Makes sense. If I remember correctly, this behavior is logged, but if it's not supported it's better not to touch `resolv.conf`. If you don't want `netbird` to change `resolv.conf` but still want to use the `netbird` DNS server, set `"DisableDNS"` to true.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#2362