DNS resolution error on the client when receiving a large response #1669

Open
opened 2025-11-20 06:04:23 -05:00 by saavagebueno · 0 comments
Owner

Originally created by @strmaks on GitHub (Mar 2, 2025).

I have several domain name based routes to provide our CI system access to external resources.
As part of migrating from Network Routes to Networks I detected at least two domain names which break resolving flow: registry.terraform.io and registry.yarnpkg.com .

When trying to access them nothing happens, after a while the error that the domain name can not be resolved is returned.
I enabled debug log level on NB client and found the next lines:

command
curl -v https://registry.yarnpkg.com

produces the next logs

2025-03-02T19:46:54+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: overflowing header size
2025-03-02T19:46:55+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: overflowing header size
2025-03-02T19:46:57+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: overflowing header size
2025-03-02T19:47:01+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: overflowing header size

command
curl -v https://registry.terraform.io
produces

2025-03-02T20:07:39+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: buffer size too small
2025-03-02T20:07:40+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: buffer size too small
2025-03-02T20:07:42+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: buffer size too small
2025-03-02T20:07:47+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: buffer size too small

But for example
curl -v https://terraform.io
works fine without any problems as well as "OLD" flow using 0.34.1 client.

After some tcpdumping on client host i detect that DNS responces for "bad" (non resolvable) names is bigger than for "good" (resolvable) names.
607 bytes for registry.terraform.io and 1074 for registry.yarnpkg.com
"good" responces is 80-200 bytes.

googling 'dns: buffer size too small' error addressed me to https://github.com/miekg/dns/issues/214 issue and suggest to increase UDP buffer size.

Currently i'm reverted back the old client to keep our system working.

To Reproduce

Create "Network Routes" for both domains
Try to access to this resources on client

Expected behavior

Domain names are successfully resolved and passed through “exit nodes”.

Are you using NetBird Cloud?

Self-Hosted NetBird

NetBird version

0.37.1
on client and "exit nodes"

Client: MacOS 15.3.1 arm64
Exit Nodes: Ubuntu Linux x86 24.04.2

Originally created by @strmaks on GitHub (Mar 2, 2025). I have several domain name based routes to provide our CI system access to external resources. As part of migrating from Network Routes to Networks I detected at least two domain names which break resolving flow: `registry.terraform.io` and `registry.yarnpkg.com` . When trying to access them nothing happens, after a while the error that the domain name can not be resolved is returned. I enabled debug log level on NB client and found the next lines: command `curl -v https://registry.yarnpkg.com` produces the next logs ``` 2025-03-02T19:46:54+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: overflowing header size 2025-03-02T19:46:55+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: overflowing header size 2025-03-02T19:46:57+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: overflowing header size 2025-03-02T19:47:01+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: overflowing header size ``` command `curl -v https://registry.terraform.io` produces ``` 2025-03-02T20:07:39+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: buffer size too small 2025-03-02T20:07:40+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: buffer size too small 2025-03-02T20:07:42+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: buffer size too small 2025-03-02T20:07:47+01:00 ERRO client/internal/routemanager/dnsinterceptor/handler.go:178: failed to exchange DNS request with 100.x.x.x:5353: dns: buffer size too small ``` But for example `curl -v https://terraform.io` works fine without any problems as well as "OLD" flow using 0.34.1 client. After some tcpdumping on client host i detect that DNS responces for "bad" (non resolvable) names is bigger than for "good" (resolvable) names. 607 bytes for registry.terraform.io and 1074 for registry.yarnpkg.com "good" responces is 80-200 bytes. googling 'dns: buffer size too small' error addressed me to https://github.com/miekg/dns/issues/214 issue and suggest to increase UDP buffer size. Currently i'm reverted back the old client to keep our system working. **To Reproduce** Create "Network Routes" for both domains Try to access to this resources on client **Expected behavior** Domain names are successfully resolved and passed through “exit nodes”. **Are you using NetBird Cloud?** Self-Hosted NetBird **NetBird version** `0.37.1` on client and "exit nodes" Client: MacOS 15.3.1 arm64 Exit Nodes: Ubuntu Linux x86 24.04.2
saavagebueno added the bugdns labels 2025-11-20 06:04:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1669