diff --git a/providers/dns/namedotcom/namedotcom.go b/providers/dns/namedotcom/namedotcom.go index 574d0abf..68248f8a 100644 --- a/providers/dns/namedotcom/namedotcom.go +++ b/providers/dns/namedotcom/namedotcom.go @@ -108,15 +108,20 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) { func (d *DNSProvider) Present(domain, token, keyAuth string) error { fqdn, value := dns01.GetRecord(domain, keyAuth) + domainDetails, err := d.client.GetDomain(&namecom.GetDomainRequest{DomainName: domain}) + if err != nil { + return fmt.Errorf("namedotcom API call failed: %v", err) + } + request := &namecom.Record{ DomainName: domain, - Host: d.extractRecordName(fqdn, domain), + Host: d.extractRecordName(fqdn, domainDetails.DomainName), Type: "TXT", TTL: uint32(d.config.TTL), Answer: value, } - _, err := d.client.CreateRecord(request) + _, err = d.client.CreateRecord(request) if err != nil { return fmt.Errorf("namedotcom: API call failed: %w", err) }