- whois/rdns: start processing top clients on startup after DNS server is started
This commit is contained in:
parent
8676cabc42
commit
6a08a9faa6
24
home/dns.go
24
home/dns.go
|
@ -75,18 +75,6 @@ func initDNSServer() {
|
||||||
config.dnsctx.rdns = InitRDNS(&config.clients)
|
config.dnsctx.rdns = InitRDNS(&config.clients)
|
||||||
config.dnsctx.whois = initWhois(&config.clients)
|
config.dnsctx.whois = initWhois(&config.clients)
|
||||||
|
|
||||||
const topClientsNumber = 100 // the number of clients to get
|
|
||||||
topClients := config.stats.GetTopClientsIP(topClientsNumber)
|
|
||||||
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()
|
initFiltering()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,6 +230,18 @@ func startDNSServer() error {
|
||||||
return errorx.Decorate(err, "Couldn't start forwarding DNS server")
|
return errorx.Decorate(err, "Couldn't start forwarding DNS server")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const topClientsNumber = 100 // the number of clients to get
|
||||||
|
topClients := config.stats.GetTopClientsIP(topClientsNumber)
|
||||||
|
for _, ip := range topClients {
|
||||||
|
ipAddr := net.ParseIP(ip)
|
||||||
|
if !ipAddr.IsLoopback() {
|
||||||
|
config.dnsctx.rdns.Begin(ip)
|
||||||
|
}
|
||||||
|
if isPublicIP(ipAddr) {
|
||||||
|
config.dnsctx.whois.Begin(ip)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue