mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 17:35:40 +08:00
dns: use Direct dialer when dialer's domain equals to the query domain
This commit is contained in:
parent
fbb78d50d4
commit
205b4efac7
@ -127,6 +127,11 @@ func (c *Client) exchange(qname string, reqBytes []byte, preferTCP bool) (server
|
||||
network = "tcp"
|
||||
dialer := c.dialer.NextDialer(qname + ":53")
|
||||
|
||||
// if we are resolving the dialer's domain, then use Direct to avoid denpency loop
|
||||
if strings.Contains(dialer.Addr(), qname) {
|
||||
dialer = proxy.Direct
|
||||
}
|
||||
|
||||
// If client uses udp and no forwarders specified, use udp
|
||||
if !preferTCP && dialer.Addr() == "DIRECT" {
|
||||
network = "udp"
|
||||
|
Loading…
Reference in New Issue
Block a user