From 9d4eaca63c31ca03a1ed1a9ed38639743d44f657 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 30 Sep 2016 09:23:27 +0200 Subject: allow to use hostname in config --- config/dhcpd.conf | 2 +- dyndhcpd.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/dhcpd.conf b/config/dhcpd.conf index 65764a8..c69f4e7 100644 --- a/config/dhcpd.conf +++ b/config/dhcpd.conf @@ -9,7 +9,7 @@ ignore client-updates; default-lease-time 21600; max-lease-time 43200; -option domain-name "__DOMAINNAME__"; +option domain-name "__HOSTNAME__.__DOMAINNAME__"; class "PXEClient" { match if substring(option vendor-class-identifier, 0, 9) = "PXEClient"; diff --git a/dyndhcpd.c b/dyndhcpd.c index a9283a0..de7a793 100644 --- a/dyndhcpd.c +++ b/dyndhcpd.c @@ -239,6 +239,7 @@ int main(int argc, char ** argv) { if (*tmp == '_') { if (replace(&config, &length, &tmp, "__INTERFACE__", interface) || replace(&config, &length, &tmp, "__VERSION__", VERSION) || + replace(&config, &length, &tmp, "__HOSTNAME__", hostname) || replace(&config, &length, &tmp, "__DOMAINNAME__", domainname) || replace(&config, &length, &tmp, "__ADDRESS__", network.address.c) || replace(&config, &length, &tmp, "__NETADDRESS__", network.netaddress.c) || -- cgit v1.2.3-70-g09d2