From 9bd5890c4055cec1731b25350a877a0474fd7e59 Mon Sep 17 00:00:00 2001 From: leonexcc Date: Fri, 26 May 2023 22:03:23 +0200 Subject: [PATCH] autodns: fixes wrong zone in api call if CNAME is used (#1923) --- providers/dns/autodns/autodns.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/providers/dns/autodns/autodns.go b/providers/dns/autodns/autodns.go index 3ab31ab1..67b98d17 100644 --- a/providers/dns/autodns/autodns.go +++ b/providers/dns/autodns/autodns.go @@ -122,8 +122,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { Value: info.Value, }} - // TODO(ldez) replace domain by FQDN to follow CNAME. - _, err := d.client.AddTxtRecords(context.Background(), domain, records) + _, err := d.client.AddTxtRecords(context.Background(), info.EffectiveFQDN, records) if err != nil { return fmt.Errorf("autodns: %w", err) } @@ -142,8 +141,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { Value: info.Value, }} - // TODO(ldez) replace domain by FQDN to follow CNAME. - if err := d.client.RemoveTXTRecords(context.Background(), domain, records); err != nil { + if err := d.client.RemoveTXTRecords(context.Background(), info.EffectiveFQDN, records); err != nil { return fmt.Errorf("autodns: %w", err) }