Commit 0791210
committed
Retry over TCP if TC bit is set for DNS TXT records and set EDNS0
TXT records can be quite large, with is a problem for DNS challenges,
they don't fit in the 512 buffer especially if there are multiple.
DNS servers can increase the buffer size through EDNS0 extension,
and retry over TCP if that wasn't enough.
DNS server should truncate response if it doesn't fit in the buffer,
and set TC (Truncate) bit, then DNS client should retry over TCP.
1220 value for UDP buffer size was chosen based on this recommendation:
https://www.isc.org/blogs/dns-flag-day-2020-2/
This changes only TXT request, I left other methods untouched.
But it would make sense to do the same logic for all requests,
by building some small abstraction around miekg/dns for requests.
Also see docs for Exchange function:
https://pkg.go.dev/github.com/miekg/dns#Client.Exchange
Was originally found in
#536 (comment)1 parent d180fbf commit 0791210
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| 143 | + | |
| 144 | + | |
142 | 145 | | |
143 | 146 | | |
144 | 147 | | |
| |||
832 | 835 | | |
833 | 836 | | |
834 | 837 | | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
835 | 841 | | |
836 | 842 | | |
837 | 843 | | |
| 844 | + | |
838 | 845 | | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
839 | 852 | | |
840 | 853 | | |
841 | 854 | | |
| |||
0 commit comments