[Dnsmasq-discuss] [FEAT.REQ] Further localisation of --localise-queries

Luca Landi me@lucalandi.com
Mon, 2 May 2005 23:36:06 +0200


Alex Hermann ha scritto:
> On Sunday 01 May 2005 14:19, Luca Landi wrote:
> > Alex Hermann ha scritto:
> > > >> server: eth0 192.168.1.1 <---> client1 : 192.168.1.101
> > > >>         eth1 192.168.1.2 <---> client2 : 192.168.1.102
> > > >>         eth2 192.168.1.3 <---> client3 : 192.168.1.103
> > > >>         eth3 public ip   <---> inet
> >
> > [...]
> > if you want your server to play the role of the switch then all you have 
> > to do is to bring up a bridge interface, [...]
> 
> Sadly enough, some things aren't possible with the (linux) bridging code. 
> My connections are a horrible mix of Gbit, 100Mbit, 10Mbit and wifi. To 
> get the max out of the Gbit connection I need a high MTU on that iface. 
> The bridging code doesn't support a MTU other than 1500 at all (or just 
> not across different bandwidth devices). Also, there seem to be some more  
> problems with my nics and bridging that need some further investigation. 

Ok, I see.

So, to go back to your original question, did you try to run three different 
instances of dnsmasq, each serving only one IP address, where two of them 
serve only DNS requests and the third one serves both DNS and DHCP? this 
way you can configure each dnsmasq instance to read a different "hosts" 
file while at the same time keep DHCP centralised. Having different "hosts" 
files let you fine tune which static IP addresses get sent to your clients. 
Basically the whole thing shoud look like this:

dnsmasq -a 192.168.1.1 -H /etc/hosts1 -h -F <your-DHCP-range-of-addresses>
dnsmasq -a 192.168.1.2 -H /etc/hosts2 -h
dnsmasq -a 192.168.1.3 -H /etc/hosts3 -h

/etc/hosts1 contains:

192.168.1.1	your-server-hostname


/etc/hosts2 contains:

192.168.1.2	your-server-hostname


/etc/hosts3 contains:

192.168.1.3	your-server-hostname

I only thought it and didn't try it but to me looks like it may work fine. 
The only remaining issue might be the '-h' option, which is needed to 
prevent dnsmasq from reading the main /etc/hosts file. If you have no 
common static hostnames to serve then I think you should be fine, else I'm 
afraid you'd have to duplicate the common static hostnames into the other 
three "hosts" files. Also remember to add a '-a 127.0.0.1' to one of the 
three instances if you need to query dnsmasq from the server machine 
itself.