Make upstream query interval configurable match the PR #15
This commit is contained in:
parent
44b4cfa24e
commit
cf02889c62
|
@ -14,6 +14,9 @@ port = 53
|
|||
[resolv]
|
||||
resolv-file = "/etc/resolv.conf"
|
||||
timeout = 5 # 5 seconds
|
||||
# The concurrency interval request upstream recursive server
|
||||
# Match the PR15, https://github.com/kenshinx/godns/pull/15
|
||||
interval = 200 # 200 milliseconds
|
||||
|
||||
[redis]
|
||||
host = "127.0.0.1"
|
||||
|
|
|
@ -56,7 +56,7 @@ func (r *Resolver) Lookup(net string, req *dns.Msg) (message *dns.Msg, err error
|
|||
}
|
||||
}
|
||||
|
||||
ticker := time.NewTicker(time.Second)
|
||||
ticker := time.NewTicker(time.Duration(settings.ResolvConfig.Interval) * time.Millisecond)
|
||||
defer ticker.Stop()
|
||||
// Start lookup on each nameserver top-down, in every second
|
||||
for _, nameserver := range r.Nameservers() {
|
||||
|
|
|
@ -27,6 +27,7 @@ type Settings struct {
|
|||
type ResolvSettings struct {
|
||||
ResolvFile string `toml:"resolv-file"`
|
||||
Timeout int
|
||||
Interval int
|
||||
}
|
||||
|
||||
type DNSServerSettings struct {
|
||||
|
|
Loading…
Reference in New Issue