netbird on macOS exposes port 53 to the public #249

Closed
opened 2025-11-20 05:08:35 -05:00 by saavagebueno · 2 comments
Owner

Originally created by @theoriginalgri on GitHub (Dec 5, 2022).

Originally assigned to: @mlsmaycon on GitHub.

Describe the problem
Netbird recently introduced the DNS feature. It seems there's a bug on macOS that port 53 is not only accessible from the local host or netbird's network but on any address.

Due to macOS's firewall only being able to control applications and not ports, this requires and additional firewall in front of macOS machines with public ip addresses - otherwise netbird gets completely blocked by the OS. In our case, a we got notified by the BSI (https://www.bsi.bund.de/) that one of our macOS machines in the Hetzner datacenter acts as public DNS resolver.

To Reproduce
Install and start netbird 0.11.3 on macOS (only tried Ventura).

You can already see netbird lists to port 53 on all addresses:

➜  ~ sudo lsof -nP -iUDP | grep ':53'
mDNSRespo   228 _mdnsresponder    6u  IPv4 0x2f4cb6f67acb43d1      0t0  UDP *:5353
mDNSRespo   228 _mdnsresponder    7u  IPv6 0x2f4cb6f67acb4701      0t0  UDP *:5353
netbird     377           root   23u  IPv4 0x2f4cb6f67a72f711      0t0  UDP *:53
netbird     377           root   30u  IPv4 0x2f4cb6f67a73bd71      0t0  UDP *:53063

Use the macOS host to resolve DNS requests from an non-netbird host:

root@grafana:~# dig +short @$MACOS_HOST_PUBLIC_IP netbird.io
54.155.53.106

Expected behavior
DNS resolution is restricted to localhost or hosts from the netbird network.

Additional context
@mlsmaycon assumed on Slack this might be related to https://github.com/miekg/dns/issues/941

Originally created by @theoriginalgri on GitHub (Dec 5, 2022). Originally assigned to: @mlsmaycon on GitHub. **Describe the problem** Netbird recently introduced the DNS feature. It seems there's a bug on macOS that port 53 is not only accessible from the local host or netbird's network but on any address. Due to macOS's firewall only being able to control applications and not ports, this requires and additional firewall in front of macOS machines with public ip addresses - otherwise netbird gets completely blocked by the OS. In our case, a we got notified by the BSI (https://www.bsi.bund.de/) that one of our macOS machines in the Hetzner datacenter acts as public DNS resolver. **To Reproduce** Install and start netbird 0.11.3 on macOS (only tried Ventura). You can already see netbird lists to port 53 on all addresses: ```shell ➜ ~ sudo lsof -nP -iUDP | grep ':53' mDNSRespo 228 _mdnsresponder 6u IPv4 0x2f4cb6f67acb43d1 0t0 UDP *:5353 mDNSRespo 228 _mdnsresponder 7u IPv6 0x2f4cb6f67acb4701 0t0 UDP *:5353 netbird 377 root 23u IPv4 0x2f4cb6f67a72f711 0t0 UDP *:53 netbird 377 root 30u IPv4 0x2f4cb6f67a73bd71 0t0 UDP *:53063 ``` Use the macOS host to resolve DNS requests from an non-netbird host: ```shell root@grafana:~# dig +short @$MACOS_HOST_PUBLIC_IP netbird.io 54.155.53.106 ``` **Expected behavior** DNS resolution is restricted to localhost or hosts from the netbird network. **Additional context** @mlsmaycon assumed on Slack this might be related to https://github.com/miekg/dns/issues/941
saavagebueno added the bugclientwaiting-feedback labels 2025-11-20 05:08:35 -05:00
Author
Owner

@nazarewk commented on GitHub (Apr 17, 2025):

@theoriginalgri is it still an issue or you in the latest version?

@nazarewk commented on GitHub (Apr 17, 2025): @theoriginalgri is it still an issue or you in the latest version?
Author
Owner

@theoriginalgri commented on GitHub (Apr 22, 2025):

@nazarewk To me it looks like this has been solved (running 0.41.3).

Running the lsof from above, I don't see netbird in the list anymore.

Also when trying dig with any ip of my local machine, I do not get a response.

@theoriginalgri commented on GitHub (Apr 22, 2025): @nazarewk To me it looks like this has been solved (running 0.41.3). Running the `lsof` from above, I don't see netbird in the list anymore. Also when trying `dig` with any ip of my local machine, I do not get a response.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#249