0

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.

xxDMxx
  • 3
  • 4
  • You can not set a windows hostname over DHCP, it simply don't accept it. But if it is only the DNS that DHCP updates then you should be able to modify that. – NiKiZe Jun 11 '22 at 09:03
  • Yes, I don't need the actual device hostname (including the windows laptop hostname) to change. I just need a dns forward entry in the zone managed by bind. I don't get these added for the above hosts. – xxDMxx Jun 12 '22 at 19:40

1 Answers1

0

Names for DNS entries should be specified by the ddns-hostname option for every client you want to create DNS record for. According to the dhcpd.conf man page:

ddns-hostname name;

The name parameter should be the hostname that will be used in setting up the client's A and PTR records. If no ddns-hostname is specified in scope, then the server will derive the hostname automatically, using an algorithm that varies for each of the different update methods.

Note that the ddns-hostname should contain the host name only, the domain name will be appended using the value given in the domain-name option.

Lacek
  • 7,233
  • 24
  • 28
  • Thanks. With this change I can override devices with malformed hostnames. For the windows domain controlled laptop though, I also had to add `ignore client-updates;` – xxDMxx Jun 16 '22 at 21:00