outgoing-interface with dhcp

The system that unbound runs on has 4 nics. nic1 is the wan port to
the internet with an ip address that comes from dhcp. How can I tell
unbound to send queries to wan0 if the ip changes?

outgoing-interface only takes ip addresses not ports. It would be nice
if I can have outgoing-interface: wan0

I guess I can make a script but for now I comment this out.

Thanks, Louis

You may not need to use outgoing-interface at all. If your DHCP-client adds a default route over the WAN interface, then that is the interface used for outgoing requests.

  outgoing-interface is most useful, if you want to use some other source IP, other than the actual outgoing (default route) interface, like a loopback address. Or if your WAN interface doesn’t have a routable IP, or something.

Tom

The system that unbound runs on has 4 nics. nic1 is the wan port to
the internet with an ip address that comes from dhcp. How can I tell
unbound to send queries to wan0 if the ip changes?

I think what you're really after is who *answers* your request for an IP
(your DHCP). This is in almost all situations, your Gateway (path to the
internet). This IP (unlike *yours*) doesn't change. So is almost always
the Gateway assigned by your OS.
IOW use the IP that your DHCP(d) gets your IP from. An easy way to find
it is via resolv.conf.

HTH

--Chris

Ok, thanks.