OPNsense Forum

English Forums => 25.1, 25.4 Series => Topic started by: knebb on July 19, 2025, 05:08:30 AM

Title: [SOLVED] Unbound using multiple DNS Servers for Query Forwarding?
Post by: knebb on July 19, 2025, 05:08:30 AM
Hi,

as far as I can tell the docs (https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound.conf.html#forward-zone-options) for Unbound say it can use multiple forwarders for query forwarding: "The servers listed as forward-host:"
In OPNSense I have not found an option to set multiple forwarders- seems like only a single one is possible.

How can I configure multiple hosts as forwad hosts?

Thanks!

/KNEBB
Title: Re: Unbound using multiple DNS Servers for Query Forwarding?
Post by: patient0 on July 19, 2025, 06:15:08 AM
What OPNsense version are you using? And how have you set the forwarding servers?

One option: you set DNS servers (IP addresses 1.1.1.1, 1.0.0.1, 8.8.8.8, 8.8.4.4 for this example) in System / General and instruct Unbound to use them for forwarding, Unbound DNS / Query Forwarding -> Use System Nameservers. Then check the generated config file, /var/unbound/unbound.conf and you'll see as many 'forward-addr' entries are you have set DNS servers in System / General.

# Forwarding
...
forward-zone:
    name: "."
        forward-addr: 1.0.0.1
        forward-addr: 1.1.1.1
        forward-addr: 8.8.8.8
        forward-addr: 8.8.4.4
...
forward-host : DNS server names
forward-addr : DNS server IPs
Title: Re: Unbound using multiple DNS Servers for Query Forwarding?
Post by: knebb on July 19, 2025, 07:33:50 AM
Hi,

sorry, I was not clear enough.

I was talking about the zone-based forwarding. I have a local DNS for my local zone. So I want Unbound to forward only those queries to my local DNS servers. And use the system configured servers for all other queries.

So yes, my Unbound uses configured "uolink" servers- except for the local domain. But for the local domain I can only add a single server in the GUI...

/KNEBB

Title: Re: Unbound using multiple DNS Servers for Query Forwarding?
Post by: patient0 on July 19, 2025, 07:57:21 AM
Quote from: knebb on July 19, 2025, 07:33:50 AMBut for the local domain I can only add a single server in the GUI...
In Query Forwarding you create two entries for the same domain, with different DNS server ips to forward to, that should work, no?
Title: Re: Unbound using multiple DNS Servers for Query Forwarding?
Post by: knebb on July 19, 2025, 09:33:10 AM
You have not tried, no?

I can not add a second entry with same domain.
Title: Re: Unbound using multiple DNS Servers for Query Forwarding?
Post by: patient0 on July 19, 2025, 09:52:08 AM
Quote from: knebb on July 19, 2025, 09:33:10 AMYou have not tried, no?
I'm on 25.7 RC2 and there is does work, what version are you on?
Screenshot 2025-07-19 at 09.48.28.png
Title: [SOVLED] Re: Unbound using multiple DNS Servers for Query Forwarding?
Post by: knebb on July 19, 2025, 10:16:09 AM
8)
Sorry- I had to log off and logon again. And then it worked. My fault!

Ok, I guess it is done now. Sorry for confusion.

Going to add a second entry for my local domains.
THANKS!