aboutsummaryrefslogtreecommitdiff
path: root/src/net/dnsclient_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/dnsclient_unix.go')
-rw-r--r--src/net/dnsclient_unix.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/net/dnsclient_unix.go b/src/net/dnsclient_unix.go
index 50e9bb0f20..6dfd4af957 100644
--- a/src/net/dnsclient_unix.go
+++ b/src/net/dnsclient_unix.go
@@ -31,6 +31,10 @@ const (
// to be used as a useTCP parameter to exchange
useTCPOnly = true
useUDPOrTCP = false
+
+ // Maximum DNS packet size.
+ // Value taken from https://dnsflagday.net/2020/.
+ maxDNSPacketSize = 1232
)
var (
@@ -83,7 +87,7 @@ func dnsPacketRoundTrip(c Conn, id uint16, query dnsmessage.Question, b []byte)
return dnsmessage.Parser{}, dnsmessage.Header{}, err
}
- b = make([]byte, 512) // see RFC 1035
+ b = make([]byte, maxDNSPacketSize)
for {
n, err := c.Read(b)
if err != nil {