0

In my local network I manage a csv file which maps MAC addresses to hostnames. This file is used to set the hostname of a client machine when it gets installed, so dynamic hostname assignment is not neccessary. The client receives a dynamic IP address via DHCP though.

Now I want to access the machine on my local network via ssh (ssh user@some_host.local). Since the IP is dynamic, I have to use the hostname.

All machines run on Linux. The DHCP server is isc-dhcp-server. I know I will have to set up DNS and plan to use bind9.

But I am still unsure about how to configure the network. How would I have to configure the DHCP and DNS servers in a way that the setup so far remains "unchanged"?

a.ilchinger
  • 121
  • 1
  • 5

1 Answers1

0

It really depends on how your network is configured and what is supported.

  • You either do what is typical for the Windows workstation hosts, make the hostname a static property of the workstation, assign a dynamic IP-address with DHCP and then have workstation register its current IP-address in your internal DNS for host name based resolving:

    Sometimes simply configuring the DHCP client to submit the hostname / FQDN it wants can be enough. See for example: https://askubuntu.com/q/990537

    Other solutions may require that your Linux system is actually a member of a Windows AD domain.

  • The opposite is more a traditional Linux solution and fits in with the administration that you're already maintaining. That is more akin to the network forcing a specific hostname unto a system:

    You configure the DHCP server to use the systems MAC address information to always hand out the same IP-address to the same host. Then you can have static mappings of hostname ==> IP-address and the reverse in your DNS.

Bob
  • 5,805
  • 7
  • 25
  • I don't have any Windows clients or servers in my network. Preferrably I do not have to add dozens of mappings to both the DHCP and DNS configs and can keep a single file in a trivial format at a central location. The link looks rather promising. – a.ilchinger Mar 23 '22 at 14:51