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