mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
* switch to new go-acme imports from xenolf. Fix api changes * update many vault related dependencies
17 lines
285 B
Go
17 lines
285 B
Go
package dns01
|
|
|
|
import "github.com/miekg/dns"
|
|
|
|
// Update FQDN with CNAME if any
|
|
func updateDomainWithCName(r *dns.Msg, fqdn string) string {
|
|
for _, rr := range r.Answer {
|
|
if cn, ok := rr.(*dns.CNAME); ok {
|
|
if cn.Hdr.Name == fqdn {
|
|
return cn.Target
|
|
}
|
|
}
|
|
}
|
|
|
|
return fqdn
|
|
}
|