[Dnsmasq-discuss] restricting listening interfaces only for DHCP

Luca Landi me@lucalandi.com
Wed, 4 May 2005 19:31:05 +0200


Dimitrios Apostolou ha scritto:
> DHCP should listen only to eth0 since I don't want to give my IP's to 
> anyone from outside. However DNS should listen to all interfaces so that 
> I can advertise my domain hostnames outside my site.

Should be easy to achieve that if you can accept to run 2 dnsmasq instances 
concurrently, one with DHCP enabled and serving eth0 only and the other one 
with DHCP disabled and serving all interfaces but eth0. In practice:

dnsmasq -i eth0 -F <DHCP-range>

and

dnsmasq -I eth0

Be also aware that this way there are actually two DNS caches living their 
own independent lives, although running on the same machine. This means 
that, for example, for each queried Internet hostname your machine will 
forward two queries to the upstream nameservers if that hostname gets 
requested both by clients on eth0 and by clients on the other interfaces. 
If you don't mind about things like that then you should be fine with that 
solution.