[Dnsmasq-discuss] how to split the resolution between networks?
Simon Kelley
simon at thekelleys.org.uk
Sun Jul 29 18:26:41 BST 2012
On 29/07/12 18:22, Wojtek Swiatek wrote:
> Hello,
>
> I have two networks (wired on eth0 (192.168.0.10) and wireless on
> wlan3 (192.168.1.10)) routed by a server which also runs dnsmasq. I
> need the name "server" to be resolved as 192.168.0.10 from the wired
> network and as 192.168.1.10 from the wireless one.
> I currently have
> 192.168.0.10 server.home
> in /etc/hosts and it works but the traffic to the server when going
> from wireless transits through the wired. This is not a huge issue but
> it would be better if the name was resolved in both ways.
>
This is what you need: from "man dnsmasq"
y, --localise-queries
Return answers to DNS queries from /etc/hosts which depend on
the interface over which the query was received. If a name in
/etc/hosts has more than one address associated with it, and at
least one of those addresses is on the same subnet as the inter‐
face to which the query was sent, then return only the
address(es) on that subnet. This allows for a server to have
multiple addresses in /etc/hosts corresponding to each of its
interfaces, and hosts will get the correct address based on
which network they are attached to. Currently this facility is
limited to IPv4.
Cheers,
Simon.
More information about the Dnsmasq-discuss
mailing list