namedotcom: get the actual registered domain so we can remove just that from the hostname to be created (#545)
This commit is contained in:
parent
fa19378184
commit
7bb614080b
1 changed files with 7 additions and 2 deletions
|
@ -108,15 +108,20 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
|
||||||
func (d *DNSProvider) Present(domain, token, keyAuth string) error {
|
func (d *DNSProvider) Present(domain, token, keyAuth string) error {
|
||||||
fqdn, value := dns01.GetRecord(domain, keyAuth)
|
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{
|
request := &namecom.Record{
|
||||||
DomainName: domain,
|
DomainName: domain,
|
||||||
Host: d.extractRecordName(fqdn, domain),
|
Host: d.extractRecordName(fqdn, domainDetails.DomainName),
|
||||||
Type: "TXT",
|
Type: "TXT",
|
||||||
TTL: uint32(d.config.TTL),
|
TTL: uint32(d.config.TTL),
|
||||||
Answer: value,
|
Answer: value,
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := d.client.CreateRecord(request)
|
_, err = d.client.CreateRecord(request)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("namedotcom: API call failed: %w", err)
|
return fmt.Errorf("namedotcom: API call failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue