1

I am looking for an option that will make unbound to send recursive queries from a specific interface.

Listening interface is easy, but I can't find asking interface option.

I have 3 interfaces on my VM and I don't want unbound to ask from default gateway, is there such an option?

Thanks.

2 Answers2

0

One solution could be to use Linux Network Namespaces:

  • create a new network namespace with a separate route table. This route table should contain the default gateway corresponding to your needed network interface;
  • run Unbound under this network namespace.
  • I wasn't aware of network namespaces. I was planning to write specific routes for each forwarder in worst case scenario. This might save me so much effort, I m gonna check it out. Thank you very much. – Çiçek Adam Oct 15 '21 at 21:50
0

I have found this option from NLNetlabs documentation:

outgoing-interface: Interface to use to connect to the network. This interface is used to send queries to authoritative servers and receive their replies. Can be given multiple times to work on several inter- faces. If none are given the default (all) is used. You can specify the same interfaces in interface: and outgoing-inter- face: lines, the interfaces are then used for both purposes. Outgoing queries are sent via a random outgoing interface to counter spoofing.

source: https://nlnetlabs.nl/documentation/unbound/unbound.conf/