[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,
> 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 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


and then restart dnsmasq.

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



> _______________________________________________
> 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