Reverse Proxy: Custom domain pushed as DNS search domain to all peers, breaking local hostname resolution #6497
Replies: 1 comment
Root Cause Found + Fix VerifiedAfter digging into the NetBird source code, I found the exact cause and confirmed a fix works. Root CauseIn // current code
zone = &nbdns.CustomZone{
Domain: dns.Fqdn(serviceDomainZone),
Records: []nbdns.SimpleRecord{},
NonAuthoritative: true,
// SearchDomainDisabled not set → defaults to false → domain gets pushed as search domain
}In Go, an unset The reverse proxy zone also gets assigned DNS order FixAdding zone = &nbdns.CustomZone{
Domain: dns.Fqdn(serviceDomainZone),
Records: []nbdns.SimpleRecord{},
NonAuthoritative: true,
SearchDomainDisabled: true,
}VerificationTested on a self-hosted NetBird stack with the patched Before fix ( After fix (same peer, same reverse proxy service still active): Short hostname resolution now correctly falls through to local DNS search domains instead of matching the reverse proxy domain first. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the problem
When a reverse proxy service is configured in NetBird using a custom domain (e.g.
app.example.com), NetBird automatically pushes that domain as a search domain to all connected peers — not just as a supplemental resolver.This inserts the reverse proxy domain before the peer's existing local search domains (e.g. pushed via DHCP), causing short hostname lookups to match the reverse proxy domain first and never reach the local DNS search domains.
To Reproduce
app.example.com)scutil --dnsapp.example.comappears in the search domain list of the primary resolver, ahead of locally configured search domainsscutil --dnsagainapp.example.comis gone — local search domains remainExpected behavior
app.example.comshould only be registered as a supplemental resolver (so that explicit queries for*.app.example.comgo through NetBird's DNS), but not added as a search domain suffix that is applied to unqualified hostnames.Actual behavior
app.example.comis injected as a search domain ahead of the peer's local DNS search domains. If any DNS record exists underapp.example.comthat matches a local short hostname (e.g.myserver.app.example.com), the local host with that name becomes unreachable — the reverse proxy domain wins silently and the local search domains are never tried.Impact
Environment
scutil --dns(macOS DNS resolver configuration)Workaround
Disable all reverse proxy services → search domain disappears and local resolution works again. Not a viable long-term fix.
All reactions