Skip to content

Commit

Permalink
autodns: fixes wrong zone in api call if CNAME is used (#1923)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonexcc committed May 26, 2023
1 parent 91bda25 commit 9bd5890
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions providers/dns/autodns/autodns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
}

Expand Down

0 comments on commit 9bd5890

Please sign in to comment.