SV: Hostname and DNS
Lars Jacobsen
lj at sydfynsel.dk
Wed May 30 14:18:45 UTC 2007
> Glenn Satchell wrote
> Something like this in an appropriate scope:
>
> ddns-hostname = option agent.circuit-id;
>
> or use pick-first-value() in case the circuit-id is not set:
>
> ddns-hostname = pick-first-value(
> option agent.circuit-id,
> option host-name,
> binary-to-ascii (16, 8, "-", substring (hardware, 1, 6)) );
>
> This is from the dhcpd.conf man page:
>
> SETTING PARAMETER VALUES USING EXPRESSIONS
> Sometimes it's helpful to be able to set the value of a DHCP
> server parameter based on some value that the client has
> sent. To do this, you can use expression evaluation. The
> dhcp-eval(5) manual page describes how to write expressions.
> To assign the result of an evaluation to an option, define
> the option as follows:
>
> my-parameter = expression ;
>
> For example:
>
> ddns-hostname = binary-to-ascii (16, 8, "-",
> substring (hardware, 1, 6));
Guess it's just that obvious.
That's because I had a few other situations where it was not
possible/simple to assign values to other parameters based on
agent.circuit-id.
And I didn't read the last page of the man, only those around DDNS ;-)
Ill try tomorrow.
Thanks
/Lars
More information about the dhcp-users
mailing list