diff --git a/dns/client.go b/dns/client.go index a0d3a383..29b4207c 100644 --- a/dns/client.go +++ b/dns/client.go @@ -155,6 +155,11 @@ func (r *Resolver) resolveIP(m *D.Msg) (msg *D.Msg, err error) { } func (r *Resolver) ResolveIP(host string) (ip net.IP, err error) { + ip = net.ParseIP(host) + if ip != nil { + return ip, nil + } + query := &D.Msg{} dnsType := D.TypeA if r.ipv6 {