From ba8980da738273bcf6aa94028b22fdf8e1cefd07 Mon Sep 17 00:00:00 2001 From: wweir Date: Sun, 17 Feb 2019 07:15:51 +0800 Subject: [PATCH] Limit dns detect timeout short than 1s for multi dns setting --- dns/dns.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/dns.go b/dns/dns.go index 6d8ab3d..cba031c 100644 --- a/dns/dns.go +++ b/dns/dns.go @@ -18,7 +18,7 @@ const colon = byte(':') func StartDNS(dnsServer, listenIP string) { ip := net.ParseIP(listenIP) - suggest := &intelliSuggest{listenIP, time.Second} + suggest := &intelliSuggest{listenIP, 800 * time.Millisecond} mem.DefaultCache = mem.New(time.Hour) dhcpCh := make(chan struct{}) @@ -108,7 +108,7 @@ func (i *intelliSuggest) GetOne(domain interface{}) (iface interface{}, e error) } // give local dial a hand, make it not so easy to be added into suggestions - util.HTTPPing(addr, addr, util.Http, i.timeout/50) + util.HTTPPing(addr, addr, util.Http, i.timeout/20) var ( pings = []struct {