This commit is contained in:
Miek Gieben 2012-08-09 22:08:14 +02:00
commit 370c423137
4 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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)

View File

@ -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())
}

View File

@ -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}
}