terraform-provider-dns icon indicating copy to clipboard operation
terraform-provider-dns copied to clipboard

CNAME data source fails if not resolvable to a host

Open BrandonALXEllisSS opened this issue 3 years ago • 1 comments

Affected Resource(s)

dns_cname_record_set data source

Terraform Configuration Files

data "dns_cname_record_set" "record" {
  host = "some.cname.entry.that.exists.but.doesnt.resolve"
}

Output

Error: error looking up CNAME records for "some.cname.entry.that.exists.but.doesnt.resolve": lookup some.cname.entry.that.exists.but.doesnt.resolve on 172.28.16.1:53: no such host

Expected Behavior

Data source does not try to resolve CNAME entry and just returns the record

Actual Behavior

Data source retrieves CNAME entry and then tries to resolve it, ultimately failing

References

This is because the data source uses the go net provider's LookupCNAME function. And for some reason, this provider has this functionality. Consider changing this so that it makes sense please

BrandonALXEllisSS avatar Oct 11 '21 12:10 BrandonALXEllisSS

yeah the cname lookup should leverage https://godoc.org/github.com/miekg/dns the way it is now it doesn't even respect the dns server config in the provider, it just uses the host machines dns

drdamour avatar Apr 03 '23 18:04 drdamour