"ddns-hostname" generated from IPv6-address?
Joachim Tingvold
joachim at tingvold.com
Mon Sep 26 18:58:31 UTC 2011
On Sep 23, 2011, at 02:27 GMT+02:00, Joachim Tingvold wrote:
> If the client doesn't provide a hostname, it should use the IPv6-address to make the hostname.
>
> "2001:20a0:4000:300::123" would become "2001-20a0-4000-300_123" (or the like). I guess "2001-20a0-4000-0300-0000-0000-0000-0123" could work too, but "2001-20a0-4000-300_123" would be preferred.
Hi,
So, I know "_" isn't a valid syntax in DNS, my bad.
I found a working solution. Since this was to be used in a /48, we only wanted the host-part of the prefix.
ddns-hostname = binary-to-ascii(16, 16, "-", suffix(substring(option dhcp6.ia-na, 16, 16), 10));
To use the example above, "2001:20a0:4000:300::123" would produce "300-0-0-0-123" as the ddns-hostname.
--
Joachim
More information about the dhcp-users
mailing list