From ee7af2771209002402f17f8a5028a599d8f214ed Mon Sep 17 00:00:00 2001 From: gVisor bot 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 {