Open Jackbennett opened 3 years ago
I am seeing almost identical behavior in a very similar situation.
My nameserver hosts domain parent.io, and also subdomain child.parent.io; if I try to update glue NS records within parent.io (which should appear in parent.io's zone file), I get the above issue. Terraform import can also not import glue NS records in the parent zone.
This is for something defined in the style of:
resource "dns_ns_record_set" "parent-glue" {
zone = "parent.io."
name = "child"
nameservers = [ "ns1.parent.io.", "ns2.parent.io." ]
ttl = 3600
}
Note that this only applies on a server that is ALSO hosting the child domain (or perhaps that the child domain just plain exists? I haven't tested it with an extant domain primarily hosted on a different server). If the child domain does not exist at the server, it will happily add/modify/destroy the glue NS records for it in the parent zone.
My best guess is that it's adding the record to the correct zone, but then reading data from the child zone rather than the parent when it goes to verify it. That's only a guess, however.
Having exact same issue when trying to delegate a subdomain, initial run is fine, subsequent ones are broken. terraform 1.1.6, terraform-provider-dns 3.2.1
My best guess is that it's adding the record to the correct zone, but then reading data from the child zone rather than the parent when it goes to verify it. That's only a guess, however.
My workaround to this has been to create an actual zone for ci.example.com
that only has the nameservers and the single admin
A record so terraform behaves on subsequent runs. So I think as quoted has nailed the issue cause.
Ran into this when trying to create an entry with _dns_a_recordset.
Version
Terraform v1.1.8 on windows_amd64
- provider registry.terraform.io/hashicorp/dns v3.2.3
Example code
resource "dns_a_record_set" "example" {
zone = "zone.com."
name = "one.two.three"
addresses = [
"8.8.8.8"
]
}
Workaround
Workaround
- Add a stub.two.three.zone.com entry manually
- Run terrform apply
- Remove stub
Does that behave upon multiple re-apply runs after? That's what I found the real bug from, you can get it to run but the issues come from running again.
So far, it's been fine on multiple applies. Seems to require the subdomain to be present before creating records there.
So far, it's been fine on multiple applies. Seems to require the subdomain to be present before creating records there.
This is did not work for me for NS resource records on MS DNS (2019) Tested using DNS provider 3.2.3 and it still doesn't work. Delegation is not being created. DNS Server responds with REFUSED
See terraform trace below:
2022-12-02T02:06:45.561Z [INFO] provider.terraform-provider-dns_v3.2.3_x5: 2022/12/02 02:06:45 [DEBUG] Sending DNS message to server (host.mydomain.com:53):
;; opcode: UPDATE, status: NOERROR, id: 18833
;; flags:; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;domain.com. IN SOA
;; AUTHORITY SECTION:
sub.domain.com. 60 IN NS ns9-09.azure-dns.com.
;; ADDITIONAL SECTION:
;; TSIG PSEUDOSECTION:
; 484559840.sig-host.mydomain.com. 0 CLASS255 TSIG gss-tsig. 20221202020645 300 0 18833 0 0: timestamp=2022-12-02T02:06:45.561Z
2022-12-02T02:06:45.566Z [INFO] provider.terraform-provider-dns_v3.2.3_x5: 2022/12/02 02:06:45 [DEBUG] Receiving DNS message from server (host.mydomain.com:53):
;; opcode: UPDATE, status: REFUSED, id: 18833
;; flags: qr; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;domain.com. IN SOA
;; AUTHORITY SECTION:
sub.domain.com. 60 IN NS ns9-09.azure-dns.com.
;; ADDITIONAL SECTION:
;; TSIG PSEUDOSECTION:
Enabled DNS server audit logs and they don't record anything meaningful. No other Windows server logs indicate the reason. Any suggestions?
I'd appreciate someone's suggestions/findings in troubleshooting this on the Windows server side. We could tackle this problem from this size.
The Terraform Provider produced inconsistent result after apply
error with the details of Root resource was present, but now absent.
should be removed by the changes in #260, however it may be the case that there is still another underlying issue which either needs to be fixed or documented better, so I'm going to leave this issue open until we see what the version 3.3.0 (releasing in the near future) behavior is after those changes.
Hi there,
Adding A record, add subdomain to A record, add NS for A record then breaks.
Terraform Version
Affected Resource(s)
Terraform Configuration Files
and the applied zonefile, no NS record:
Add NS
tf plan:
tf apply: Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
tf plan:
zone after
tf apply:
Debug Output
any tips before I spend 30min sanitizing the debug log?
Expected Behavior
Created dns A record, subdomain in A record and also NS for A record
Actual Behavior
Records Created, but terraform chokes on subsequent runs.
Important Factoids
TF from ubuntu linux targeting an ubuntu bind9 server. no clouds involved.
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
Sorry to adjust your issue template slightly, I had most of this formatted while debugging the issue myself. Please forgive me.