Add secondary support

Allow specifying a primary server and retrieve the zone's content.

Add tests and an Expired bool to zone struct, to stop server zones

that are expired. The zone is retrieved on Startup, no updates of

changed content are done. We also don't respond to notifies yet.
This commit is contained in:
Miek Gieben
2016-04-03 09:02:34 +01:00
parent 7fb959470e
commit f58f1e4285
12 changed files with 252 additions and 50 deletions

View File

@@ -107,6 +107,15 @@ func TestLookup(t *testing.T) {
}
}
func TestLookupNil(t *testing.T) {
fm := File{Next: coretest.ErrorHandler(), Zones: Zones{Z: map[string]*Zone{testzone: nil}, Names: []string{testzone}}}
ctx := context.TODO()
m := dnsTestCases[0].Msg()
rec := middleware.NewResponseRecorder(&middleware.TestResponseWriter{})
fm.ServeDNS(ctx, rec, m)
}
func BenchmarkLookup(b *testing.B) {
zone, err := Parse(strings.NewReader(dbMiekNL), testzone, "stdin")
if err != nil {