mirror of
https://github.com/joohoi/acme-dns.git
synced 2025-07-05 15:58:32 +07:00
Merge pull request #49 from Yannik/patch-1
return cname if requested RR was not found and cname exists (fixes #48)
This commit is contained in:
4
dns.go
4
dns.go
@ -51,9 +51,13 @@ func answer(q dns.Question) ([]dns.RR, int, error) {
|
|||||||
var domain = strings.ToLower(q.Name)
|
var domain = strings.ToLower(q.Name)
|
||||||
var rtype = q.Qtype
|
var rtype = q.Qtype
|
||||||
r, ok := RR.Records[rtype][domain]
|
r, ok := RR.Records[rtype][domain]
|
||||||
|
if !ok {
|
||||||
|
r, ok = RR.Records[dns.TypeCNAME][domain]
|
||||||
if !ok {
|
if !ok {
|
||||||
rcode = dns.RcodeNameError
|
rcode = dns.RcodeNameError
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
log.WithFields(log.Fields{"qtype": dns.TypeToString[rtype], "domain": domain, "rcode": dns.RcodeToString[rcode]}).Debug("Answering question for domain")
|
log.WithFields(log.Fields{"qtype": dns.TypeToString[rtype], "domain": domain, "rcode": dns.RcodeToString[rcode]}).Debug("Answering question for domain")
|
||||||
return r, rcode, nil
|
return r, rcode, nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user