dnspod: improve search accuracy when a domain have more than 100 records (#1354)

This commit is contained in:
StackoverFrog 2021-02-27 22:55:45 +08:00 committed by GitHub
parent 55baf65065
commit 22a991d8cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -174,14 +174,14 @@ func (d *DNSProvider) findTxtRecords(domain, fqdn string) ([]dnspod.Record, erro
return nil, err
}
recordName := extractRecordName(fqdn, zoneName)
var records []dnspod.Record
result, _, err := d.client.Records.List(zoneID, "")
result, _, err := d.client.Records.List(zoneID, recordName)
if err != nil {
return records, fmt.Errorf("API call has failed: %w", err)
}
recordName := extractRecordName(fqdn, zoneName)
for _, record := range result {
if record.Name == recordName {
records = append(records, record)