diff --git a/providers/dns/dynu/dynu.go b/providers/dns/dynu/dynu.go index c2df9fb4..9a9e9858 100644 --- a/providers/dns/dynu/dynu.go +++ b/providers/dns/dynu/dynu.go @@ -97,8 +97,7 @@ func (d *DNSProvider) Timeout() (timeout, interval time.Duration) { func (d *DNSProvider) Present(domain, token, keyAuth string) error { fqdn, value := dns01.GetRecord(domain, keyAuth) - // TODO(ldez) replace domain by FQDN to follow CNAME. - rootDomain, err := d.client.GetRootDomain(domain) + rootDomain, err := d.client.GetRootDomain(dns01.UnFqdn(fqdn)) if err != nil { return fmt.Errorf("dynu: could not find root domain for %s: %w", domain, err) } @@ -115,7 +114,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { } } - subDomain, err := dns01.ExtractSubDomain(fqdn, domain) + subDomain, err := dns01.ExtractSubDomain(fqdn, rootDomain.DomainName) if err != nil { return fmt.Errorf("dynu: %w", err) } @@ -142,8 +141,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { fqdn, value := dns01.GetRecord(domain, keyAuth) - // TODO(ldez) replace domain by FQDN to follow CNAME. - rootDomain, err := d.client.GetRootDomain(domain) + rootDomain, err := d.client.GetRootDomain(dns01.UnFqdn(fqdn)) if err != nil { return fmt.Errorf("dynu: could not find root domain for %s: %w", domain, err) }