[Dnsmasq-discuss] How to conditionally forward a query based on the source IP?

/dev/rob0 rob0 at gmx.co.uk
Fri Jun 17 13:55:35 BST 2016


On Sun, Jun 12, 2016 at 02:45:17PM +0000, Wojtek Swiatek wrote:
> I am trying to find a way to forward a DNS request to a specifc DNS 
> server, based on the IP address of the requesting host.
> 
> In other words I would like dnsmasq to forward (as an example) 
> queries from the host 10.10.10.1's to DNS server 8.8.8.8 and when 
> the query comes from any another host - to 8.8.4.4.
> 
> Is this something achievable with dnsmasq? (I found a way to do it 
> based on the target domain, but this is not what I am looking for).

This would be trivial to do in BIND, using view and acl features.[1]

However, even there, it sounds quite strange.  Why do you need this?
If you're using dnsmasq in front of a BIND named with views, just go 
straight to the named.

[1]
acl eight { 10.10.10.1; };
acl four { any; };

view eight {
	match-clients { eight; };
	forwarders { 8.8.8.8; };
};
view four {
	match-clients { four; };
	forwarders { 8.8.4.4; };
};
-- 
  http://rob0.nodns4.us/
  Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:



More information about the Dnsmasq-discuss mailing list