merge
This commit is contained in:
commit
370c423137
|
@ -2,8 +2,6 @@
|
|||
|
||||
* outgoing [AI]xfr
|
||||
* fix 'q' standardize ipv6 input with [::1]#53 ?
|
||||
* use function callback with {}interface... for async querying...?
|
||||
* Fix tsig and Exchange*()
|
||||
* Splitoff fksd
|
||||
|
||||
## Nice to have
|
||||
|
|
|
@ -96,6 +96,9 @@ func serve(w dns.ResponseWriter, req *dns.Msg, z *dns.Zone) {
|
|||
return
|
||||
} else { // NoData reply or CNAME
|
||||
m.SetReply(req)
|
||||
if cname, ok := node.RR[dns.TypeCNAME]; ok {
|
||||
m.Answer = cname // tODO
|
||||
}
|
||||
m.Ns = apex.RR[dns.TypeSOA]
|
||||
ednsFromRequest(req, m)
|
||||
w.Write(m)
|
||||
|
|
|
@ -14,7 +14,9 @@ func (c *Config) ReadZoneFile(origin, file string) error {
|
|||
z := dns.NewZone(origin)
|
||||
for rr := range dns.ParseZone(f, origin, file) {
|
||||
if rr.Error == nil {
|
||||
z.Insert(rr.RR)
|
||||
if e := z.Insert(rr.RR); e != nil {
|
||||
logPrintf("failed to insert record: %s\n", e.Error())
|
||||
}
|
||||
} else {
|
||||
logPrintf("failed to parse: %s\n", rr.Error.Error())
|
||||
}
|
||||
|
|
2
zone.go
2
zone.go
|
@ -52,7 +52,7 @@ func NewZone(origin string) *Zone {
|
|||
|
||||
// Insert inserts an RR into the zone. Duplicate data overwrites the old data.
|
||||
func (z *Zone) Insert(r RR) error {
|
||||
if !IsSubDomain(r.Header().Name, z.Origin) {
|
||||
if !IsSubDomain(z.Origin, r.Header().Name) {
|
||||
return &Error{Err: "out of zone data", Name: r.Header().Name}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue