Hostname and DNS
Glenn Satchell
Glenn.Satchell at uniq.com.au
Wed May 30 13:44:12 UTC 2007
>Subject: Hostname and DNS
>Date: Wed, 30 May 2007 15:17:10 +0200
>From: "Lars Jacobsen" <lj at sydfynsel.dk>
>To: <dhcp-users at isc.org>
>
>Is it possible to set/force the client-hostname to ie. Opt.82 CID ?
>Or another way to update DDNS to circuitID.example.org
>
>Example this lease:
>
>lease 85.27.135.233 {
> starts 3 2007/05/30 12:08:20;
> ends 3 2007/05/30 13:08:20;
> binding state active;
> next binding state free;
> billing subclass "2115-ch2" "2115192";
> hardware ethernet 00:03:2f:20:00:1c;
> uid "\001\000\003/ \000\034";
> option agent.circuit-id "2115192";
> client-hostname "802.11b Wireless Router";
>
>I would like the DNS to be: "2151192.example.org" not "802.11b Wireless
>Router.example.org"
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));
regards,
-glenn
More information about the dhcp-users
mailing list