mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 10:13:14 -04:00 
			
		
		
		
	Support outgoing zone transfers
These can be enabled by adding "transfer out" to the Corefile. Without it no AXFR is allowed. For now only AXFR and no IXFR. No TSIG and no ACLs.
This commit is contained in:
		| @@ -1,10 +1,5 @@ | ||||
| package file | ||||
|  | ||||
| // TODO(miek): the zone's implementation is basically non-existent | ||||
| // we return a list and when searching for an answer we iterate | ||||
| // over the list. This must be moved to a tree-like structure and | ||||
| // have some fluff for DNSSEC (and be memory efficient). | ||||
|  | ||||
| import ( | ||||
| 	"io" | ||||
| 	"log" | ||||
| @@ -19,7 +14,6 @@ type ( | ||||
| 	File struct { | ||||
| 		Next  middleware.Handler | ||||
| 		Zones Zones | ||||
| 		// Maybe a list of all zones as well, as a []string? | ||||
| 	} | ||||
|  | ||||
| 	Zones struct { | ||||
| @@ -40,6 +34,11 @@ func (f File) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i | ||||
| 		return f.Next.ServeDNS(ctx, w, r) | ||||
| 	} | ||||
|  | ||||
| 	if state.Proto() != "udp" && state.QType() == dns.TypeAXFR { | ||||
| 		xfr := Xfr{z} | ||||
| 		return xfr.ServeDNS(ctx, w, r) | ||||
| 	} | ||||
|  | ||||
| 	rrs, extra, result := z.Lookup(qname, state.QType(), state.Do()) | ||||
|  | ||||
| 	m := new(dns.Msg) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user