"ddns-domainname" with dhcp-eval

Nicolas C. dhcp at nryc.fr
Mon May 12 13:22:46 UTC 2014


Le 12/05/2014 09:55, Peter Rathlev a écrit :
> On Sat, 2014-05-10 at 13:42 +0200, Nicolas C. wrote:
>> Instead, I have to declare another variable (e.g. "ddns-domain") and
>> pass this variable to the script.
>>
>> subnet 172.20.10.0 netmask 255.255.254.0 {
>> [...]
>> ddns-domainname "my.domain.com";
>> set ddns-domain = "my.domain.com";
>>
>> on commit {
>> 	execute ("/usr/local/bin/script", ddns-domain);
>> 	}
>> }
>
> You should be able to use
>
>    pick-first-value(config-option server.ddns-domainname, "(empty)")
>
> You need "config-option" and the "server" namespace. My guess is that
> normal parsing (outside the commit event) will try to search for a
> matching option somewhere in the available namespaces, but that this
> doesn't work inside the commit. And "config-option" is needed for
> options that are defined in dhcpd.conf and not sent by the client.


Thanks, it works.

Nicolas


More information about the dhcp-users mailing list