From b594cbc68d36abe46092735fbc978a31d829327a Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Sat, 2 Feb 2019 21:11:27 +0800 Subject: [PATCH] Fix: parse ip string when use socks proxy (#100) --- dns/client.go | 5 +++++ 1 file changed, 5 insertions(+) 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 {