remove main dns cache

This commit is contained in:
Jason
2019-07-16 14:00:54 +08:00
parent 0bb86d6345
commit 42dc5055af
5 changed files with 25 additions and 36 deletions

View File

@@ -148,14 +148,14 @@ func (h *tcpHandler) Handle(conn net.Conn, target *net.TCPAddr) error {
}
// Replace with a domain name if target address IP is a fake IP.
var targetHost string
if h.fakeDns != nil && h.fakeDns.IsFakeIP(target.IP) {
targetHost = h.fakeDns.IPToHost(target.IP)
} else {
targetHost = target.IP.String()
var targetHost = target.IP.String()
if h.fakeDns != nil {
if t := h.fakeDns.IPToHost(target.IP); t != "" {
targetHost = t
}
}
dest := net.JoinHostPort(targetHost, strconv.Itoa(target.Port))
dest := net.JoinHostPort(targetHost, strconv.Itoa(target.Port))
c, err := dialer.Dial(target.Network(), dest)
if err != nil {
return err