<div>Hi Simon,</div><div><br><div class="gmail_quote"><div>On Sat, 8 Apr 2017 at 00:21, Simon Kelley <<a href="mailto:simon@thekelleys.org.uk">simon@thekelleys.org.uk</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I understand the desire to be able to specify resolvers dynamically with<br class="gmail_msg">
the full set of source-address and routing options; that's actually<br class="gmail_msg">
already available, and has been for a long time, using the DBus<br class="gmail_msg">
interface to dnsmasq, which includes the "SetDomainServers" method,<br class="gmail_msg">
which takes strings identical to argument to --server. I've not looked<br class="gmail_msg">
at the code, but your previous patch to allow binding both IP and<br class="gmail_msg">
interface should have automatically added that feature to<br class="gmail_msg">
SetDomainServers. (if it didn't then I'd certainly take a patch to<br class="gmail_msg">
correct that.)</blockquote><div><br></div><div>Thanks for pointing me to the DBus-interface, that does indeed sound like the correct approach. I will test if SetDomaimServers automatically support the server/interface/adress syntax, and provide a patch if not.</div><div><br></div><div>Have a nice weekend,</div><div>Kristian</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
Cheers,<br class="gmail_msg">
<br class="gmail_msg">
Simon.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
On 23/03/17 18:16, Kristian Evensen wrote:<br class="gmail_msg">
> Automatically specifying which source address and interface to be used for<br class="gmail_msg">
> communicating with a given DNS server is very convenient on multihomed hosts.<br class="gmail_msg">
> Two use-cases I have had for this feature are:<br class="gmail_msg">
><br class="gmail_msg">
> * Several mobile broadband providers hand out private IP-addresses, but the DNS<br class="gmail_msg">
> servers are global. Unless special routing rules are added, then the default<br class="gmail_msg">
> route will be used for resolving domains. This is not ideal, as it might lead to<br class="gmail_msg">
> higher latencies for replies, or an additional cost to the user if DNS requests<br class="gmail_msg">
> to the "local" servers are free.<br class="gmail_msg">
><br class="gmail_msg">
> * Several mobile broadband devices act as small routers, and some of the most<br class="gmail_msg">
> popular types only hand out the same IP, DNS server, etc. To make matters worse,<br class="gmail_msg">
> if these devices loose connectivity, they will highjack any DNS request and<br class="gmail_msg">
> reply with its own IP. If you have multiple of these devices, you risk being<br class="gmail_msg">
> stuck without working DNS as all requests might be forwarded to the disconnected<br class="gmail_msg">
> device. Adding support for binding to interface and IP will make sure that<br class="gmail_msg">
> requests are sent to the correct device. Some external tool will still be<br class="gmail_msg">
> required to check that DNS is working fine and updating the resolv-file<br class="gmail_msg">
> accordingly.<br class="gmail_msg">
><br class="gmail_msg">
> Dnsmasq already supports reading and binding to an ip-adress/interface through<br class="gmail_msg">
> the --server option. This patch adds support for specifying which source address<br class="gmail_msg">
> and/or interface to use for a server in the resolv-file, using the same syntax<br class="gmail_msg">
> as for --server. For example, in order to specify that source ip 100.76.125.47<br class="gmail_msg">
> and interface wwan1 should be used to communicate with server 213.158.199.1, the<br class="gmail_msg">
> following line would have to be added to the resolv-file:<br class="gmail_msg">
><br class="gmail_msg">
> nameserver 213.158.199.1@100.76.125.47@wwan1<br class="gmail_msg">
><br class="gmail_msg">
> Since the syntax is not standard, the --multihomed-resolver command line option<br class="gmail_msg">
> must be enabled. Please note that lines with and without source<br class="gmail_msg">
> address/interface can be mixed.<br class="gmail_msg">
><br class="gmail_msg">
> Since we now have two places where the interface-part of --server is parsed, I<br class="gmail_msg">
> have factored out this parsing into a separate function. parse_server() is<br class="gmail_msg">
> converted to use this function.<br class="gmail_msg">
><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
Dnsmasq-discuss mailing list<br class="gmail_msg">
<a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk" class="gmail_msg" target="_blank">Dnsmasq-discuss@lists.thekelleys.org.uk</a><br class="gmail_msg">
<a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</a><br class="gmail_msg">
</blockquote></div></div>