Fix: domain dns should follow hosts config, close #1318
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/Dreamacro/clash/component/dialer"
|
||||
"github.com/Dreamacro/clash/component/resolver"
|
||||
|
||||
D "github.com/miekg/dns"
|
||||
)
|
||||
@ -83,12 +84,12 @@ func newDoHClient(url string, r *Resolver) *dohClient {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ip, err := r.ResolveIPv4(host)
|
||||
ip, err := resolver.ResolveIPWithResolver(host, r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return dialer.DialContext(ctx, "tcp4", net.JoinHostPort(ip.String(), port))
|
||||
return dialer.DialContext(ctx, "tcp", net.JoinHostPort(ip.String(), port))
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user