Score:0

Multiple hosts with the same hostname on the same network?

gu flag
QF0

Hypothetical situation: I have two (Linux) computers on the same network with the same hostname, but different FQDNs (foo.example.com and foo.example.org).

They have different MAC addresses, and get their IP addresses from a DHCP server.

What problems is this likely to cause, if any? In particular, there's no DNS in this network, and IP addresses are looked up from /etc/hosts and the Windows equivalent. Can /etc/hosts contain multiple entries with the same alias, or should I just omit the alias?

Score:1
cn flag
Bob

There is no a priori technical problem with several or even every stand-alone system in your network using the same hostname to refer to itself. They can even all use the same FQDN to refer to themselves. There is even a reserved hostname for that, localhost and you frequently see localhost.localdomain and variations as well, but feel free to name all your systems foo.example.com.

Problems can and most likely will arise when your systems are not completely stand-alone and belong to the same management domain.

Many tooling requires that hosts have unique hostnames and will look only at the hostname component of the FQDN. As far as I know that is for example the case when hosts want to join an Active Directory domain.

The moment you introduce the human operator in the mix, well... Others are probably more detail oriented than I am, but I will most likely confuse this foo with that foo and will frequently patch, reboot, power off the wrong systems in your network.

QF0 avatar
gu flag
QF0
Thanks - makes sense. One is a staging VM for another VM, and they need to be as similar as possible. I'm pretty sure that I can keep humans at bay...
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.