checker: build owner FQDN from _domain subdomain label + apex
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e85d06d6cd
commit
355f2b92eb
1 changed files with 11 additions and 8 deletions
|
|
@ -318,16 +318,19 @@ func defaultResolveHost(ctx context.Context, target string) (verdict, detail str
|
||||||
|
|
||||||
// ownerFQDN returns the record owner FQDN, preferring the service's _domain field over subdomain+apex.
|
// ownerFQDN returns the record owner FQDN, preferring the service's _domain field over subdomain+apex.
|
||||||
func ownerFQDN(svcDomain, sub, apex string) string {
|
func ownerFQDN(svcDomain, sub, apex string) string {
|
||||||
if svcDomain != "" {
|
fallback := func() string {
|
||||||
return strings.TrimSuffix(svcDomain, ".")
|
if apex == "" {
|
||||||
|
return sub
|
||||||
|
}
|
||||||
|
if sub == "" || sub == "@" {
|
||||||
|
return apex
|
||||||
|
}
|
||||||
|
return sub + "." + apex
|
||||||
}
|
}
|
||||||
if apex == "" {
|
if svcDomain == "" {
|
||||||
return sub
|
return fallback()
|
||||||
}
|
}
|
||||||
if sub == "" || sub == "@" {
|
return preferRRName(svcDomain, fallback(), apex)
|
||||||
return apex
|
|
||||||
}
|
|
||||||
return sub + "." + apex
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// preferRRName returns the RR header Name as an FQDN when present.
|
// preferRRName returns the RR header Name as an FQDN when present.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue