[GH-ISSUE #5969] [Bug Report] Potential DNS race condition #12592

Closed
opened 2026-08-05 02:06:14 -04:00 by saavagebueno · 2 comments
Owner

Originally created by @centerionware on GitHub (Apr 22, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5969

Describe the problem

An application rapidly tries to resolve a DNS name only available when connected to netbird. If it tries to query while netbird is connecting, it seems to fail forever until I reconnect netbird after stopping the offending application and restarting it. DNS resolution fails system wide if it fails.

To Reproduce

Specifically I'm using substreamer and navidrome hitting this issue, it's likely easily reproducible by a shell script that queries a search domain name extremely rapidly (a few times a second at least) constantly and simply reconnecting. I'm using the Android client application, I don't know if it's an issue with the client application itself or netbird core.

My setup: Netbird in Kubernetes (latest image tag netbirdio/netbird-server )
Netbird operator in the same cluster
Expose services with operator

  • Add coredns as a nameserver for svc.cluster.local and media.server.

  • add the three kubernetes routers and the peer group to distribution clients (if I don't add the routers it seems to fail).

  • add cloudflare nameserver for all domains and all distribution group.

  • Add zone called media.server,

    • set zone as search domain (but not in nameserver section, only in zone section)
  • Add cname entry (eg: music.media.server -> navidrome.navidrome.svc.cluster.local)

Using substreamer to then connect to http://music (which resolves to music.media.server then to navidrome.navidrome.svc.cluster.local)

If the substreamer app is running, it will rapidly try to reconnect when things like a network switch happens, causing it to spam DNS queries.

It seems like right after it connects it tries to query, but it's not connected to any peers yet or something and resolution fails for that particular cname , and it stays failed. I can't open it in chrome or anywhere else. However the rest of the cnames that weren't being queried when the client was reconnecting resolve just fine. If I force stop the offending app, reconnect the peer, then open the app resolution works just fine.

I suspect it's some race condition.

Expected behavior

DNS to always resolve when connected

Are you using NetBird Cloud?

Self hosted

NetBird version

v0.68.3

Is any other VPN software installed?

Tailscale

Have you tried these troubleshooting steps?

  • [ ] Reviewed client troubleshooting (if applicable)
  • [ ] Checked for newer NetBird versions
  • [ ] Searched for similar issues on GitHub (including closed ones)
  • [ ] Restarted the NetBird client
  • [ ] Disabled other VPN software
  • [ ] Checked firewall settings
Originally created by @centerionware on GitHub (Apr 22, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5969 **Describe the problem** An application rapidly tries to resolve a DNS name only available when connected to netbird. If it tries to query while netbird is connecting, it seems to fail forever until I reconnect netbird after stopping the offending application and restarting it. DNS resolution fails system wide if it fails. **To Reproduce** Specifically I'm using substreamer and navidrome hitting this issue, it's likely easily reproducible by a shell script that queries a search domain name extremely rapidly (a few times a second at least) constantly and simply reconnecting. I'm using the Android client application, I don't know if it's an issue with the client application itself or netbird core. My setup: Netbird in Kubernetes (latest image tag netbirdio/netbird-server ) Netbird operator in the same cluster Expose services with operator * Add coredns as a nameserver for svc.cluster.local and media.server. * add the three kubernetes routers and the peer group to distribution clients (if I don't add the routers it seems to fail). * add cloudflare nameserver for all domains and all distribution group. * Add zone called media.server, * set zone as search domain (but not in nameserver section, only in zone section) * Add cname entry (eg: music.media.server -> navidrome.navidrome.svc.cluster.local) Using substreamer to then connect to http://music (which resolves to music.media.server then to navidrome.navidrome.svc.cluster.local) If the substreamer app is running, it will rapidly try to reconnect when things like a network switch happens, causing it to spam DNS queries. It seems like right after it connects it tries to query, but it's not connected to any peers yet or something and resolution fails for that particular cname , and it stays failed. I can't open it in chrome or anywhere else. However the rest of the cnames that weren't being queried when the client was reconnecting resolve just fine. If I force stop the offending app, reconnect the peer, then open the app resolution works just fine. I suspect it's some race condition. **Expected behavior** DNS to always resolve when connected **Are you using NetBird Cloud?** Self hosted **NetBird version** v0.68.3 **Is any other VPN software installed?** Tailscale **Have you tried these troubleshooting steps?** - [ ✅ ] Reviewed [client troubleshooting](https://docs.netbird.io/how-to/troubleshooting-client) (if applicable) - [ ✅ ] Checked for newer NetBird versions - [ ✅ ] Searched for similar issues on GitHub (including closed ones) - [ ✅ ] Restarted the NetBird client - [ ✅ ] Disabled other VPN software - [ ✅ ] Checked firewall settings
saavagebueno added the triage-needed label 2026-08-05 02:06:14 -04:00
Author
Owner

@centerionware commented on GitHub (Apr 27, 2026):

Probably pebkac. When I changed the groups around by:
made nameserver distribution group only the routers,
then the dns zone distribution group only the devices that should easy access them. Also removed media.server from nameserver since it's an "ephemeral zone" and left only as zone name.

I can switch networks fine and this all seems to work. I'm still learning.

<!-- gh-comment-id:4324198050 --> @centerionware commented on GitHub (Apr 27, 2026): Probably pebkac. When I changed the groups around by: made nameserver distribution group only the routers, then the dns zone distribution group only the devices that should easy access them. Also removed media.server from nameserver since it's an "ephemeral zone" and left only as zone name. I can switch networks fine and this all seems to work. I'm still learning.
Author
Owner

@centerionware commented on GitHub (Apr 27, 2026):

There's still a "bug" hammer attack though because resolution failed during mesh initialization and it continues to fail throughout the session

<!-- gh-comment-id:4324352015 --> @centerionware commented on GitHub (Apr 27, 2026): There's still a "bug" hammer attack though because resolution failed during mesh initialization and it continues to fail throughout the session
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#12592