mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 02:03:20 -04:00 
			
		
		
		
	middleware/httpproxy: disable v6 lookup
Don't lookup the AAAA dns.google.com.
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user