* whois: use the upstream server to resolve whois server hostname
Close #1535 Squashed commit of the following: commit 7755d7a50e48db5d341029e1c21da95a396d9090 Merge: e24e945f5c2ca690Author: Simon Zolin <s.zolin@adguard.com> Date: Wed May 27 14:41:24 2020 +0300 Merge remote-tracking branch 'origin/master' into 1535-whois-resolve commit e24e945f9b949e3cabcddb3a8a62962bb7a5b0b9 Merge: db764710355e634fAuthor: Simon Zolin <s.zolin@adguard.com> Date: Wed May 27 14:29:44 2020 +0300 Merge remote-tracking branch 'origin/master' into 1535-whois-resolve commit db764710a0f0b60293f7bdf6b0d7b858d56819e0 Author: Simon Zolin <s.zolin@adguard.com> Date: Wed May 27 12:57:00 2020 +0300 fix commit dc38f668d5845cfd696b3107a8f02dda4f10298e Author: Simon Zolin <s.zolin@adguard.com> Date: Wed May 27 12:44:10 2020 +0300 * whois: use the upstream server to resolve whois server hostname
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package home
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
@@ -120,7 +121,7 @@ func (w *Whois) query(target string, serverAddr string) (string, error) {
|
||||
if addr == "whois.arin.net" {
|
||||
target = "n + " + target
|
||||
}
|
||||
conn, err := net.DialTimeout("tcp", serverAddr, time.Duration(w.timeoutMsec)*time.Millisecond)
|
||||
conn, err := customDialContext(context.TODO(), "tcp", serverAddr)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user