Closed andreaugustoaragao closed 2 years ago
Hi @andreaugustoaragao! Sorry this isn't working, and thanks for reporting it.
From the messaging here it seems that Terraform has concluded that it should make DNS requests by connecting to a nameserver running on localhost.
I think an important detail to determine here is: should Terraform be resolving DNS using a DNS server on localhost? Or to ask the question another way: is the problem here what Terraform is using the wrong nameserver, or is this the correct nameserver to use but for some reason Terraform is failing to connect to it even though your other software can connect to it okay?
This distinction is important because it will help understand if the problem is in the detection of the resolver configuration or if this is some other problem with the actual DNS client after it has already determined the correct DNS server address.
If you can share it without betraying any sensitive data, it may be helpful to share the contents of your system's /etc/resolv.conf
and /etc/nsswitch.conf
files.
Thanks again!
Thank you for your reply. It sent me in the right direction. All is working now!
For reference, I'm using arch linux with systemd-resolved.
The solution to the problem can be found here:
Reference:
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Using a very simple script that is failing during initialization (downloading provider packages).
What caught my attention in the logs was this: Get │ "https://registry.terraform.io/.well-known/terraform.json": dial tcp: lookup registry.terraform.io on [::1]:53:
I tested DNS resolution and all is working perfectly fine. I tested and I can reach registry.terraform.io url using curl (https://registry.terraform.io/.well-known/terraform.json).
The full output with logs is below: