I have a DHCP+DNS setup on my network using bind9
and isc-dhcp-server
. It works fine for all clients that have a "proper" hostname configured without any special setup in dhcpd.conf
in the server. There are also a couple of hosts I have setup with fixed addresses using blocks like the following:
option domain-name "dyna.mynet";
host someserver {
hardware ethernet 00:11:22:33:44:55;
fixed-address someserver.mynet; # someserver.mynet has a DNS entry in bind9
server-name "nameserver.mynet";
}
So using the above, this host is reachable via someserver.mynet
and via someserver.dyna.mynet
.
However, without the fixed-address
I can't get host sections like this working.
e.g. Another host block in the same dhcpd.conf
host worklaptop {
hardware ethernet AA:BB:CC:DD:EE:00;
}
I've also tried:
host worklaptop {
hardware ethernet AA:BB:CC:DD:EE:00;
option host-name "worklaptop";
}
Neither works. I don't see any entries like Added new forward map from ...
as I would expect in the logs.
Is there anything else I need to add?
Edit:
Just to clarify based on one of the comments, I don't need the actual device hostnames to change. I just need a DNS entry to be added, so I can address these devices using a DNS name.
Related info:
I think what the problem might be with the laptop is that it is a windows laptop and advertises the hostname with full work AD domain name e.g. worklaptop.mywork.com
. And i don't have a DNS Zone for mywork.com
in my LAN.
The other devices that don't get a name are things like Elgato lights, that have spaces in their hostname. I can't seem to override those hostnames either with these host
blocks in the dhcpd.conf
file.