From ada704e0aeaecb174d276ba201ce4ce906a7fd2c Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Wed, 30 Nov 2016 20:12:14 +0000 Subject: [PATCH] middleware/httpproxy: disable v6 lookup Don't lookup the AAAA dns.google.com. --- middleware/httpproxy/google.go | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/middleware/httpproxy/google.go b/middleware/httpproxy/google.go index ff8d83fbf..68186c232 100644 --- a/middleware/httpproxy/google.go +++ b/middleware/httpproxy/google.go @@ -109,13 +109,8 @@ func (g *google) OnStartup() error { if err != nil { return err } - r.SetQuestion(dns.Fqdn(ghost), dns.TypeAAAA) - new6, err := g.lookup(r) - if err != nil { - return err - } - up, _ := newSimpleUpstream(append(new, new6...)) + up, _ := newSimpleUpstream(new) g.Lock() g.addr = up g.Unlock() @@ -133,14 +128,8 @@ func (g *google) OnStartup() error { log.Printf("[WARNING] Failed to lookup A records %q: %s", ghost, err) continue } - r.SetQuestion(dns.Fqdn(ghost), dns.TypeAAAA) - new6, err := g.lookup(r) - if err != nil { - log.Printf("[WARNING] Failed to lookup AAAA records %q: %s", ghost, err) - continue - } - up, _ := newSimpleUpstream(append(new, new6...)) + up, _ := newSimpleUpstream(new) g.Lock() g.addr = up g.Unlock() @@ -188,9 +177,6 @@ func (g *google) lookup(r *dns.Msg) ([]string, error) { if a, ok := an.(*dns.A); ok { ret = append(ret, net.JoinHostPort(a.A.String(), "443")) } - if a, ok := an.(*dns.AAAA); ok { - ret = append(ret, net.JoinHostPort(a.AAAA.String(), "443")) - } } if len(ret) > 0 { return ret, nil