Score:0

Make static hostname visible via DNS (and dynamic IP)

nl flag

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"?

Score:0
cn flag
Bob

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.

a.ilchinger avatar
nl flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.