Skip to content

Commit bf3d444

Browse files
authored
Merge pull request #3419 from Nino-K/fix-hostagent-delay
Fix slow image pull caused by delayed DNS response
2 parents bf08ddb + d282ea1 commit bf3d444

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

pkg/hostagent/dns/dns.go

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@ import (
1111
"runtime"
1212
"strconv"
1313
"strings"
14-
"time"
1514

1615
"github.com/miekg/dns"
1716
"github.com/sirupsen/logrus"
1817
)
1918

20-
const (
21-
// Truncate for avoiding "Parse error" from `busybox nslookup`
22-
// https://github.com/lima-vm/lima/issues/380
23-
truncateSize = 512
24-
ipv6ResponseDelay = time.Second
25-
)
19+
// Truncate for avoiding "Parse error" from `busybox nslookup`
20+
// https://github.com/lima-vm/lima/issues/380
21+
const truncateSize = 512
2622

2723
var defaultFallbackIPs = []string{"8.8.8.8", "1.1.1.1"}
2824

@@ -168,12 +164,6 @@ func (h *Handler) handleQuery(w dns.ResponseWriter, req *dns.Msg) {
168164
switch q.Qtype {
169165
case dns.TypeAAAA:
170166
if !h.ipv6 {
171-
// Unfortunately some older resolvers use a slow random source to set the Transaction ID.
172-
// This creates a problem on M1 computers, which are too fast for that implementation:
173-
// Both the A and AAAA queries might end up with the same id. Therefore, we wait for
174-
// 1 second and then we return NODATA for AAAA. This will allow the client to receive
175-
// the correct response even when both Transaction IDs are the same.
176-
time.Sleep(ipv6ResponseDelay)
177167
// See RFC 2308 section 2.2 which suggests that NODATA is indicated by setting the
178168
// RCODE to NOERROR along with zero entries in the response.
179169
reply.SetRcode(req, dns.RcodeSuccess)

0 commit comments

Comments
 (0)