1

I am trying to configure Dhcp client/server on my Linux box.

My current dhcp client config has the following

send host-name "<hostname>";
request host-name

How does the server handle both of them? When the client requests for a hostname, it will give it a hostname which the client can set, but what the use of the client sending the hostname. What will be the server config in order to handle this, how is the server config different when the client requests for a hostname

Does it make sense for the client to just use "send host-name", If so, what is the use case?

0

1 Answer 1

3

The server receives a DHCP request, which includes the MAC address and may or may not include the hostname.

This means the server can identify the device by its MAC address, OR by its hostname (if present), and based on this, can decide which IP address etc. this particular machine should get. It can also send back a hostname, even if different one from the one in the request, if it decices to do so.

Use cases:

  • You can have DHCP server that has a database of MAC addresses, and sends back the hostname based on the MAC address, so you don't need to configure the hostname on your clients. Or it may use a numbered hostname scheme, and assign this client an unused one. Great if you need to administer hundreds of machines.

  • You can have a DHCP server that identifies machines by hostname. Then if you change the network card and therefore the MAC address, it will still get the same IP.

  • My Fritzbox home router uses the hostname it gets with the request as the default name when it sees a new device for the first time. However, you can edit that name in the web UI, and devices get identified by MAC address.

And so on, the DHCP server can use this information in whatever way it likes.

1
  • A DHCP server that is integrated with a DNS content server can, also, keep the name to IP address and IP address to name mappings that are published by the content DNS server up-to-date.
    – JdeBP
    Nov 18, 2017 at 9:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .