Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

127.0.0.1:53 conflicts #14

Closed
axute opened this issue Jun 19, 2023 · 11 comments
Closed

127.0.0.1:53 conflicts #14

axute opened this issue Jun 19, 2023 · 11 comments

Comments

@axute
Copy link

axute commented Jun 19, 2023

Problem/Motivation

Hello, the addon unfortunately has conflicts with port 53. I have Adguard and unfortunately 127.0.0.1:53 is occupied, so unfortunately I can only start one container.

Expected behavior

127.0.0.1:53 is not used like in the original container

@mlsmaycon
Copy link
Collaborator

@axute NetBird will attempt to listen on port 53, and if it fails, it should listen to port 5053. Can you share your netbird container logs so we can investigate more?

@axute
Copy link
Author

axute commented Jun 22, 2023

This happens, if I start Adguard before:

2023-06-22T16:15:33+02:00 WARN client/internal/dns/server.go:181: binding dns on 100.100.9.173:53 is not available, error: listen udp 100.100.9.173:53: bind: cannot assign requested address
2023-06-22T16:15:33+02:00 WARN client/internal/dns/server.go:181: binding dns on 127.0.0.1:53 is not available, error: listen udp 127.0.0.1:53: bind: address already in use

the container starts, but I have to disable the start on boot, because netbird starts also if the port is bind, but adguard fails to start.

@mlsmaycon
Copy link
Collaborator

Got it; in this case, you can configure the agent to run in userspace mode by setting the environment variable NB_WG_KERNEL_DISABLED=true, which will give you a similar performance as the normal mode but might cost a bit more CPU.

An alternative is to disable DNS management in the dashboard > DNS > Settings by adding a group your peer belongs to.

Lastly you can also force the agent to use a specific port with the environment variable NB_DNS_RESOLVER_ADDRESS=127.0.0.1:5053

@axute
Copy link
Author

axute commented Jun 22, 2023

okay, the DNS management I found in the dashboard, but the issue is only on home assistant.
I would like to change the client, how could I set an environment variable in the home assistant configuration?

@lfarkas
Copy link
Collaborator

lfarkas commented Jun 25, 2023

imho in this case netbird should have to listen on different ip then 127.0.0.1 eg: 127.0.0.24:53 and if the host (as in case of home assistant) runs systemd-resolved then and this dns as a resolver for .netbird.cloud

@lfarkas
Copy link
Collaborator

lfarkas commented Jun 25, 2023

This happens, if I start Adguard before:

2023-06-22T16:15:33+02:00 WARN client/internal/dns/server.go:181: binding dns on 100.100.9.173:53 is not available, error: listen udp 100.100.9.173:53: bind: cannot assign requested address
2023-06-22T16:15:33+02:00 WARN client/internal/dns/server.go:181: binding dns on 127.0.0.1:53 is not available, error: listen udp 127.0.0.1:53: bind: address already in use

anyway imho it's rather an adguard bug then netbird. adguard shouldn't have to or try to listen on *:53 rather only on 127.0.0.x:53 and <public ip>:53. in this case netbird can listen on 100.100.9.173:53.. so imho you should report it on adguard...

@axute
Copy link
Author

axute commented Jun 25, 2023

Yes I have already done that, it even binds the port hard coded. But he is of the opinion that I should look for the reason why the port is busy and fix it.
It's difficult for me because neither the Adguard server nor the Netbird client can be configured in this regard.

@axute axute closed this as completed Jun 25, 2023
@axute
Copy link
Author

axute commented Jun 25, 2023

Just for history reasons: hassio-addons/addon-adguard-home#432

@lfarkas
Copy link
Collaborator

lfarkas commented Jun 25, 2023

I added extra env variable setting to the config. after adding this to the config:

- name: NB_DNS_RESOLVER_ADDRESS
  value: 127.0.0.1:5053

i see this in the log

2023-06-25T15:32:35+02:00 DEBG client/internal/dns/server.go:140: starting dns on 127.0.0.1:5053
2023-06-25T15:32:35+02:00 WARN client/internal/dns/server.go:311: the DNS manager of this peer doesn't support custom port. Disabling primary DNS setup. Learn more at: https://netbird.io/docs/how-to-guides/nameservers#local-resolver

may be this would be good for you

@lfarkas
Copy link
Collaborator

lfarkas commented Jun 25, 2023

and an updated version will use systemd-resolved so probably working without extra environment variable

@axute
Copy link
Author

axute commented Jun 26, 2023

OK, thanks for the engagement. Currently I can't see DNS problems anymore (v0.21.7).
2023-06-26T09:35:23+02:00 INFO client/internal/dns/file_linux.go:103: created a NetBird managed /etc/resolv.conf file with your DNS settings. Added 1 search domains. Search list: netbird.selfhosted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants