mirror of
https://github.com/coredns/coredns.git
synced 2025-11-13 23:42:40 -05:00
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:
@@ -22,7 +22,7 @@ func (x Xfr) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (in
|
||||
return dns.RcodeServerFailure, nil
|
||||
}
|
||||
if state.QType() != dns.TypeAXFR {
|
||||
return 0, fmt.Errorf("file: xfr called with non xfr type: %d", state.QType())
|
||||
return 0, fmt.Errorf("file: xfr called with non transfer type: %d", state.QType())
|
||||
}
|
||||
if state.Proto() == "udp" {
|
||||
return 0, fmt.Errorf("file: xfr called with udp")
|
||||
@@ -39,7 +39,7 @@ func (x Xfr) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (in
|
||||
go tr.Out(w, r, ch)
|
||||
|
||||
j, l := 0, 0
|
||||
records = append(records, records[0])
|
||||
records = append(records, records[0]) // add closing SOA to the end
|
||||
for i, r := range records {
|
||||
l += dns.Len(r)
|
||||
if l > transferLength {
|
||||
|
||||
Reference in New Issue
Block a user