[GH-ISSUE #3443] [BUG] Linux Client can not set DNS with custom port #7226

Open
opened 2026-08-05 01:12:06 -04:00 by saavagebueno · 0 comments
Owner

Originally created by @0xf61 on GitHub (Mar 5, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/3443

Describe the problem

Hello, we are using Netbird to access our assets. We self-hosting everything btw. We assumed that it would not be too much of a problem to change DNS port 53 to 531. This leads us to no problem on Windows, Android, iOS, and macOS clients. Unfortunately, I assume there is an unhandled situation here on Linux clients. First of all, Netbird up perfectly sets up the IP which has to be set by Netbird but there is a small issue that it can not set it from 53 to 531. I assume this is not handled on systemd-resolved and netbird client does not cover it.

To Reproduce

Steps to reproduce the behavior:

  1. In the setup change dns port 53 to 531 ( see screenshot )
  2. On Linux client run "netbird up"
  3. Check /etc/resolv.conf to see netbird dns is set up correctly.
  4. dig a internal.netbird and dig -p 531 a internal.netbird address.
  5. See that setting port 531 resolves it but not default configuration solves the issue.

Expected behavior
I believe it should resolve the domains even DNS port is differ from 53.

Are you using NetBird Cloud?

No we are using selfhosted version of netbird.

NetBird version

0.37.1

NetBird status -dA output:

If applicable, add the `netbird status -dA' command output.

Do you face any (non-mobile) client issues?

No we don't have any issues on mobile clients.

Screenshots
As you can see the port is set to 531.

Image

When it asked on 531 port it works.

Image

Additional context

We have no problem on any other device but only Linux client has this issue.
I solved the issue on my side with below this command btw:

sudo iptables -t nat -A OUTPUT -p tcp --dport domain -j DNAT --to-destination 100.68.147.238:531
sudo iptables -t nat -A OUTPUT -p udp --dport domain -j DNAT --to-destination 100.68.147.238:531

I open this issue and share my solution if no solution can be provided by netbird.

Originally created by @0xf61 on GitHub (Mar 5, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/3443 **Describe the problem** Hello, we are using Netbird to access our assets. We self-hosting everything btw. We assumed that it would not be too much of a problem to change DNS port 53 to 531. This leads us to no problem on Windows, Android, iOS, and macOS clients. Unfortunately, I assume there is an unhandled situation here on Linux clients. First of all, `Netbird up` perfectly sets up the IP which has to be set by Netbird but there is a small issue that it can not set it from 53 to 531. I assume this is not handled on systemd-resolved and netbird client does not cover it. **To Reproduce** Steps to reproduce the behavior: 1. In the setup change dns port 53 to 531 ( see screenshot ) 2. On Linux client run "netbird up" 3. Check /etc/resolv.conf to see netbird dns is set up correctly. 4. `dig a internal.netbird` and `dig -p 531 a internal.netbird` address. 5. See that setting port 531 resolves it but not default configuration solves the issue. **Expected behavior** I believe it should resolve the domains even DNS port is differ from 53. **Are you using NetBird Cloud?** No we are using selfhosted version of netbird. **NetBird version** 0.37.1 **NetBird status -dA output:** If applicable, add the `netbird status -dA' command output. **Do you face any (non-mobile) client issues?** No we don't have any issues on mobile clients. **Screenshots** As you can see the port is set to 531. ![Image](https://github.com/user-attachments/assets/1ef08abc-01bc-4c2e-9ca6-1a04285703d2) When it asked on 531 port it works. ![Image](https://github.com/user-attachments/assets/cc3de4af-4c23-4be9-8c6c-942af0e0e4b8) **Additional context** We have no problem on any other device but only Linux client has this issue. I solved the issue on my side with below this command btw: ``` sudo iptables -t nat -A OUTPUT -p tcp --dport domain -j DNAT --to-destination 100.68.147.238:531 sudo iptables -t nat -A OUTPUT -p udp --dport domain -j DNAT --to-destination 100.68.147.238:531 ``` I open this issue and share my solution if no solution can be provided by netbird.
saavagebueno added the clientdnslinux labels 2026-08-05 01:12:06 -04:00
Sign in to join this conversation.
No Label client dns linux
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#7226