I want to use wget on multi-homed machines, and I use routing rules to
route pkts
out specific interfaces based on the source IP.
So, I need to be able to bind to a local IP address, including for the
resolver logic,
which is why I want to use libcares.
To test, I think it would be sufficient to put two IPs on a port
(1.1.1.1, 1.1.1.2), and then
use cmd-line args to choose one or the other. Sniff and watch for
proper source address.
For DNS servers, have 1.1.1.3 and 1.1.1.4 be specified. Sniff and
watch to see that the
resolver destination IP is as specified. This should be completely
independent of whatever
is in /etc/resolv.conf, etc.
I (and others) have patched libcares and curl in the past to handle
all of this,
so I know libcares can do it. I think the main work is to handle new
cmd-line
arguments, pass appropriate info to libcares, and make wget use
libcares for it's
resolve logic.
Thanks,
Ben