"ddns-domainname" with dhcp-eval

Peter Rathlev peter at rathlev.dk
Mon May 12 07:55:19 UTC 2014


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.

HTH.

-- 
Peter




More information about the dhcp-users mailing list