0

I have read the question "How to set the fully qualified domain name", and I am trying to understand the difference between "the" hostname (it seems there is only one) and the domain names (via DNS, where I can have many names for a single IP address).

Is it true that the hostname in /etc/hostname is just a company internal name, so that I can distinguish different machines? Is this the name which folks name according Star Wars avatars, Greek philosophers etc.? Does this name ever matter to anyone outside the company if there's no DNS entry for it?

Example:

/etc/hostname contains

alpha

my DNS domain is example.com and DNS knows www.example.com and mail.example.com

Thomas Weller
  • 4,617
  • 4
  • 24
  • 36

1 Answers1

1

/etc/hostname is what tells the computer itself what it is called. It has nothing (much) to do with the outside world. It affects things like what name is in command prompts, and what the computer reports its name as to the local network through avahi (mypc.local).

For anything as seen from the outside world you must use a Domain Name Server which is a completely different kettle of fish and provides mappings between symbolic names (FQDN) and IP addresses.

Majenko
  • 484
  • If you are in a network with a DHCP server, it may use the name in /etc/hostname as the name for your computer on the network when it assigns an IP address to your machine. – NZD Dec 14 '15 at 02:50
  • Amongst other things. None of them have anything to do with external DNS resolution. – Majenko Dec 14 '15 at 02:52