From d75620fdc04cd1958a224023f1afca949d5265b0 Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Mon, 7 Oct 2019 15:57:34 +0300 Subject: [PATCH] + whois, rdns: begin getting info for the most active clients on startup --- home/dns.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/home/dns.go b/home/dns.go index 2a08db3b..3e58ffb1 100644 --- a/home/dns.go +++ b/home/dns.go @@ -60,6 +60,18 @@ func initDNSServer() { config.dnsctx.rdns = InitRDNS(&config.clients) config.dnsctx.whois = initWhois(&config.clients) + + topClients := config.stats.GetTopData(30) + for _, ip := range topClients { + ipAddr := net.ParseIP(ip) + if !ipAddr.IsLoopback() { + config.dnsctx.rdns.Begin(ip) + } + if isPublicIP(ipAddr) { + config.dnsctx.whois.Begin(ip) + } + } + initFiltering() }