Skip to content

Commit

Permalink
inwx: delete only the TXT record related to the DNS challenge (#2373)
Browse files Browse the repository at this point in the history
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
  • Loading branch information
jhbruhn and ldez authored Dec 3, 2024
1 parent eb04104 commit 2c13835
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions providers/dns/inwx/inwx.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,26 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
return fmt.Errorf("inwx: %w", err)
}

var lastErr error
var recordID int
for _, record := range response.Records {
err = d.client.Nameservers.DeleteRecord(record.ID)
if err != nil {
lastErr = fmt.Errorf("inwx: %w", err)
if record.Content != challengeInfo.Value {
continue
}

recordID = record.ID
break
}

if recordID == 0 {
return errors.New("inwx: TXT record not found")
}

err = d.client.Nameservers.DeleteRecord(recordID)
if err != nil {
return fmt.Errorf("inwx: %w", err)
}

return lastErr
return nil
}

// Timeout returns the timeout and interval to use when checking for DNS propagation.
Expand Down

0 comments on commit 2c13835

Please sign in to comment.