browningluke / terraform-provider-opnsense

OPNsense Terraform Provider
https://registry.terraform.io/providers/browningluke/opnsense/latest
MIT License
51 stars 12 forks source link

DNS Query Forward not appearing in UI #49

Open tomjones1977 opened 3 months ago

tomjones1977 commented 3 months ago

The opnsense_unbound_forward (Resource) correctly configures a query forward to an internal DNS server, but the record does not appear anywhere in the UI:

opnsense_unbound_forward.query: Creating...
opnsense_unbound_forward.query: Creation complete after 2s [id=5a8fc7f3-5040-482e-86e8-8cfa3ac3b274]

image

browningluke commented 3 months ago

Hi there @tomjones1977, thanks for opening this issue!

Firstly, if you re-run terraform apply, does it want to recreate the resource? (i.e. did the provider correctly create the resource). If it does try to recreate it, let me know because there might be a bug with the mutex locking.

However, it's probably due to the fact that the provider creates forwards using Unbound's DNS over TLS section:

image

This is because the DoT section is a superset of the old Query Forwarding section. To create a regular DNS Query Forward:

// Query Forward
resource "opnsense_unbound_forward" "query" {
  domain = "example.lan"
  server_ip = "192.168.1.2"
  server_port = 53 # set this to 53 (which forwards as expected, or omit the parameter to default to 53)
}

I suspect you've already configured everything correctly, but just aren't looking under the /ui/unbound/dot section of the UI. This is probably a fault of the documentation and I will update it to make it more clear.