-
Notifications
You must be signed in to change notification settings - Fork 553
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
Errors on resolution of long domain names with forwardKubeDNSToHost #8763
Comments
@DmitriyMV this clearly looks like a bug |
I think I can explain what's happening here: in your last example you are bypassing coredns server and ask your own dns on openwrt, so it works. The culprit here is CoreDNS itself which doesn't support dns compression nor does it support setting custom value for limiting udp packet size for dns messages. It uses the default limit of 512 bytes. Increasing bufsize to 4096 (maximum allowed limit per RFC 6891) doesn't help here either since it happens much later and already uses reasonable default of 1232. There are solution to this: you can force CoreDNS to use
Or maybe even with
I will also add support for bigger dns messages on our side, but until CoreDNS fixes this, our fix will not help. With CoreDNS config above it starts working:
|
By default, github.com/miekg/dns uses `dns.MinMsgSize` for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size to `dns.DefaultMsgSize` 4096 bytes, which is the maximum size of a dns packet payload per RFC 6891. Also increase CoreDNS dns request payload limit to 4096 from the default 1232 bytes. For siderolabs#8763 Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
If I understand correctly, CoreDNS shouldn't resolve long domain names no matter But it successfully resolved I may wrong, but for me, it's looks like a problem appears when we have this chain |
- By default, github.com/miekg/dns uses `dns.MinMsgSize` for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size to `dns.DefaultMsgSize` 4096 bytes, which is the maximum size of a dns packet payload per RFC 6891. - Another thing we do is increasing CoreDNS dns request payload limit to 4096 from the default 1232 bytes. - We also retry the request if the response is truncated or previous connection was closed. - And finally we properly handle the case where the response is larger than the client buffer size, and we return a truncated correct response. Closes siderolabs#8763 Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
- By default, github.com/miekg/dns uses `dns.MinMsgSize` for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size to `dns.DefaultMsgSize` 4096 bytes, which is the maximum size of a dns packet payload per RFC 6891. - Another thing we do is increasing CoreDNS dns request payload limit to 4096 from the default 1232 bytes. - We also retry the request if the response is truncated or previous connection was closed. - And finally we properly handle the case where the response is larger than the client buffer size, and we return a truncated correct response. Closes siderolabs#8763 Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
- By default, github.com/miekg/dns uses `dns.MinMsgSize` for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size to `dns.DefaultMsgSize` 4096 bytes, which is the maximum size of a dns packet payload per RFC 6891. - Another thing we do is increasing CoreDNS dns request payload limit to 4096 from the default 1232 bytes. - We also retry the request if the response is truncated or previous connection was closed. - And finally we properly handle the case where the response is larger than the client buffer size, and we return a truncated correct response. Closes siderolabs#8763 Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
- By default, github.com/miekg/dns uses `dns.MinMsgSize` for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size to `dns.DefaultMsgSize` 4096 bytes, which is the maximum size of a dns packet payload per RFC 6891. - We also retry the request if the response is truncated or previous connection was closed. - And finally we properly handle the case where the response is larger than the client buffer size, and we return a truncated correct response. We test long responses using "video-edge-3e7abd.pdx01.abs.hls.ttvnw.net" which is Twitch subdomain. Closes siderolabs#8763 Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
- By default, github.com/miekg/dns uses `dns.MinMsgSize` for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size to `dns.DefaultMsgSize` 4096 bytes, which is the maximum size of a dns packet payload per RFC 6891. - We also retry the request if the response is truncated or previous connection was closed. - And finally we properly handle the case where the response is larger than the client buffer size, and we return a truncated correct response. We test long responses using "video-edge-3e7abd.pdx01.abs.hls.ttvnw.net" which is Twitch subdomain. Closes siderolabs#8763 Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
- By default, github.com/miekg/dns uses `dns.MinMsgSize` for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size to `dns.DefaultMsgSize` 4096 bytes, which is the maximum size of a dns packet payload per RFC 6891. - We also retry the request if the response is truncated or previous connection was closed. - And finally we properly handle the case where the response is larger than the client buffer size, and we return a truncated correct response. We test long responses using "video-edge-3e7abd.pdx01.abs.hls.ttvnw.net" which is Twitch subdomain. Closes siderolabs#8763 Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
- By default, github.com/miekg/dns uses `dns.MinMsgSize` for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size to `dns.DefaultMsgSize` 4096 bytes, which is the maximum size of a dns packet payload per RFC 6891. - We also retry the request if the response is truncated or previous connection was closed. - And finally we properly handle the case where the response is larger than the client buffer size, and we return a truncated correct response. We test long responses using "video-edge-3e7abd.pdx01.abs.hls.ttvnw.net" which is Twitch subdomain. Closes siderolabs#8763 Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
- By default, github.com/miekg/dns uses `dns.MinMsgSize` for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size to `dns.DefaultMsgSize` 4096 bytes, which is the maximum size of a dns packet payload per RFC 6891. - We also retry the request if the response is truncated or previous connection was closed. - And finally we properly handle the case where the response is larger than the client buffer size, and we return a truncated correct response. Closes siderolabs#8763 Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
@Sad-Soul-Eater so after further investigation we found out that our dns server didn't properly truncate responses, so CoreDNS didn't retry queries for the long and truncated responses using TCP (as it should). #8768 should fix that. |
- By default, github.com/miekg/dns uses `dns.MinMsgSize` for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size to `dns.DefaultMsgSize` 4096 bytes, which is the maximum size of a dns packet payload per RFC 6891. - We also retry the request if the response is truncated or previous connection was closed. - And finally we properly handle the case where the response is larger than the client buffer size, and we return a truncated correct response. Closes siderolabs#8763 Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
- By default, github.com/miekg/dns uses `dns.MinMsgSize` for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size to `dns.DefaultMsgSize` 4096 bytes, which is the maximum size of a dns packet payload per RFC 6891. - We also retry the request if the response is truncated or previous connection was closed. - And finally we properly handle the case where the response is larger than the client buffer size, and we return a truncated correct response. Closes siderolabs#8763 Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com> (cherry picked from commit a9cf9b7)
- By default, github.com/miekg/dns uses `dns.MinMsgSize` for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size to `dns.DefaultMsgSize` 4096 bytes, which is the maximum size of a dns packet payload per RFC 6891. - We also retry the request if the response is truncated or previous connection was closed. - And finally we properly handle the case where the response is larger than the client buffer size, and we return a truncated correct response. Closes siderolabs#8763 Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com> (cherry picked from commit a9cf9b7)
Bug Report
Description
I get errors when I try to resolve long domain name (e.g.
video-edge-3e7abd.pdx01.abs.hls.ttvnw.net
) with forwardKubeDNSToHost enabledLogs
nslookup to kube-dns service
coredns logs:
nslookup to host-dns service
nslookup to upstream localhost openwrt
upstream dns in talos
Environment
hostDNS settings:
The text was updated successfully, but these errors were encountered: