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]
|
||||||
resolv-file = "/etc/resolv.conf"
|
resolv-file = "/etc/resolv.conf"
|
||||||
timeout = 5 # 5 seconds
|
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]
|
[redis]
|
||||||
host = "127.0.0.1"
|
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()
|
defer ticker.Stop()
|
||||||
// Start lookup on each nameserver top-down, in every second
|
// Start lookup on each nameserver top-down, in every second
|
||||||
for _, nameserver := range r.Nameservers() {
|
for _, nameserver := range r.Nameservers() {
|
||||||
|
|
|
@ -27,6 +27,7 @@ type Settings struct {
|
||||||
type ResolvSettings struct {
|
type ResolvSettings struct {
|
||||||
ResolvFile string `toml:"resolv-file"`
|
ResolvFile string `toml:"resolv-file"`
|
||||||
Timeout int
|
Timeout int
|
||||||
|
Interval int
|
||||||
}
|
}
|
||||||
|
|
||||||
type DNSServerSettings struct {
|
type DNSServerSettings struct {
|
||||||
|
|
Loading…
Reference in New Issue