OPNsense Forum

Archive => 22.7 Legacy Series => Topic started by: charris on January 13, 2023, 06:49:49 PM

Title: How to list all DNS entries in Unbound?
Post by: charris on January 13, 2023, 06:49:49 PM
Is there a way to list all of the DNS entries in Unbound?

I'm trying to use Unbound for local DNS and local lookups are not working so I would like to see if it has any entries in its list.

LAN IP is 10.0.0.1

Here are some things I have tried in various combinations in case it's obvious what I'm doing wrong.

Under System > Settings > General
- I have tried having no DNS servers, and including 10.0.0.1

- I have tried checking and unchecking "Allow DNS server list to be overridden by DHCP/PPP on WAN"

- I have tried checking and unchecking "Do not use the local DNS service as a nameserver for this system"

Under Services > Unbound DNS > General
- "Enable Unbound" is checked, and I confirmed when it is unchecked that I cannot do lookups for external domains

- "Register DHCP leases" is checked

- "Register DHCP static mappings" is checked

- "Register IPv6 link-local addresses" is checked

Under Services > Unbound DNS > Log File
- "Log Queries" is checked
- "Log Replies" is checked
- "Log Level Verbosity" is Level 5

Under Services > Unbound DNS > Log File
I have searched the logs for my queries, but I am not seeing any indication of them.
Title: Re: How to list all DNS entries in Unbound?
Post by: phaze75 on March 16, 2023, 09:49:34 AM
Hi,

I've got the same question. I would also be able to display the full list of DNS entries, but did not find a way to do that within OPNsense...

The fact, that 'unbound-control' is disabled by default does not help either:

root@OPNsense:~ # unbound-control list_local_zones
[1678956760] unbound-control[53183:0] warning: control-enable is 'no' in the config file.
[1678956765] unbound-control[53183:0] fatal error: timeout: could not connect to server

Best regards!
Title: Re: How to list all DNS entries in Unbound?
Post by: cookiemonster on March 16, 2023, 04:27:52 PM
I might be leading you astray but I see contents in /var/unbound/dhcpleases.conf for example. Whether that's the place Unbound looks in for solving you registered leases, I don't know.
It doesn't matter a lot though. Ordinarily to get Unbound for DHCPv4. to give you your local hosts as per dhcp leases you just need:

Under Services > Unbound DNS > General
- "Register DHCP leases" is checked
- "Register DHCP static mappings" is checked

If it "doesn't work", please show the diagnostic done and from where. Check if you have a domain set for your lan and run a "dig a-host.your-domain" from your opnsense console or a lan client should resolve.