|
@@ -40,14 +40,17 @@ func serve(w dns.ResponseWriter, req *dns.Msg, z *Zone) {
|
|
|
|
|
|
m := new(dns.Msg)
|
|
m := new(dns.Msg)
|
|
m.SetReply(req)
|
|
m.SetReply(req)
|
|
|
|
+ ednsFromRequest(req, m)
|
|
|
|
+
|
|
m.MsgHdr.Authoritative = true
|
|
m.MsgHdr.Authoritative = true
|
|
|
|
+ m.Authoritative = true
|
|
|
|
|
|
- // TODO(ask): Function to find appropriate label with records based on the country/continent
|
|
|
|
labels := z.findLabels(label, *country, qtype)
|
|
labels := z.findLabels(label, *country, qtype)
|
|
if labels == nil {
|
|
if labels == nil {
|
|
// return NXDOMAIN
|
|
// return NXDOMAIN
|
|
m.SetRcode(req, dns.RcodeNameError)
|
|
m.SetRcode(req, dns.RcodeNameError)
|
|
- ednsFromRequest(req, m)
|
|
|
|
|
|
+ m.Authoritative = true
|
|
|
|
+
|
|
w.Write(m)
|
|
w.Write(m)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -75,7 +78,6 @@ func serve(w dns.ResponseWriter, req *dns.Msg, z *Zone) {
|
|
|
|
|
|
fmt.Println("Writing reply")
|
|
fmt.Println("Writing reply")
|
|
|
|
|
|
- ednsFromRequest(req, m)
|
|
|
|
w.Write(m)
|
|
w.Write(m)
|
|
return
|
|
return
|
|
}
|
|
}
|