[Dnsmasq-discuss] Variable DNS server address in dnsmasq configuration

Simon Kelley simon at thekelleys.org.uk
Tue Nov 15 07:23:18 GMT 2005


S.V. Groeneveld wrote:
> I know about this option in /etc/dnsmasq.conf:
> dhcp-option=6,192.168.0.1
> 
> It specifies the DNS server that will be passed to DHCP clients.
> 
> But I'd like to specify a secondary DNS server there, and the IP 
> address  is variable (and could be found in 
> /var/run/dhclient.eth0.leases on my  system).
> 
> The question is this: is it possible to use variable addresses for  
> dhcp-options?
> 

Not in general. It's possible to use 0.0.0.0 to mean "the address of the 
host running dnsmasq" but that doesn't help you.

I suggest a bit of scripting in the dhclient script to extract the 
relevant address and write it into a file as

dhcp-option=6,xx.xx.xx.xx

and then restart dnsmasq.

Use conf-file=<filename> in /etc/dnsmasq.conf to include the dynamically 
generated fragment.

Cheers,

Simon.

> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 




More information about the Dnsmasq-discuss mailing list