What's the purpose of hostnames?

Hey!

I’m wondering what purpose do hostnames or FQDNs have in a local network? Or even in a global network like www.

For every device I setup, I had to set a hostname or FQDN.
For example my IPFire has “ipfire.local”. A vm has “debian-vm.local”.
It could also be “bla.domain.xyz” or whatever…

I can’t access these machines through the hostname.
A config at the DNS server is always required.

But when I setup the DNS server to access server 10.0.0.1 through “bla.local” this will also work without setting a hostname at the destination machine. Hostnames seem totally irrelevant to me.

  • What purpose do hostnames fulfill?
  • Could I just setup crazy FQDNs with different domains & tlds for machines in my local network and nobody would even care?

I’d appreciate if someone could clarify this for me.
I’ve already searched the web but most things I found were “how can I access ip X through hostname X?”

Thanks!

.local is a special domain that is reserved for multicast DNS. It allows to plug a machine to the network and have nothing else to configure to start talking to it. This is common with printers for example.

But mDNS requires each machine on your network to have a daemon listening for mDNS requests. This is fine for small home networks but the distributed nature of mDNS makes it challenging for bigger networks. It is rarely used outside of consumer things.

Note that if you have a machine called foo.domain.com that has mDNS enabled you will be able to address it with:

  • foo using normal DNS if your search domain if set to domain.com
  • foo.domain.com using normal DNS
  • foo.local using mDNS

The same role as on the Internet: if you only have a handful of machines using their IP works well, more than that and having a name to identify machines becomes very useful.

You can but you shouldn’t use a random domain that you do not own. Organizations used to use domains like .localdomain, .local, .lan or .home for their internal network which created a big mess a few years ago when new TLD were created. This is the reason the .home TLD does not exist.

  • If you own a domain name, just use it. You can name your printer printer.office.your-domain.com for example.
  • If you do not own a domain, there is a special one you can use made for that home.arpa so you could name your printer printer.home.arpa. See https://tools.ietf.org/html/rfc8375

And that’s fine! If you don’t feel the need to don’t use them. Just keep in mind that many systems will still ask you for a name because they are often supposed to be deployed as part of a bigger infrastructure where names matter.

I hope this helps!

2 Likes