Traditional Naming Themes
Traditionally the idea behind hostnames and how you set them up is something like this.
Most organisations have a name, like Wonder Widget, LLC for example. Usually this translates into one or maybe two main domain names like wonderwidget.com. Now most organisations will probably have multiple computers used for multiple things. Each computer might just be a resource for employees to work on, so at the beginning of the day, if you’re an employee you get to the office sign on to the main computer and do your work, save your files and log out and go home. That way your files are always on the main computer for your boss or your company or whoever to have and use and make use of.
Most companies have limited resources and at least not too long ago one computer could only handle the work of a few users, lets say maybe one computer is or was good for about 5-10 users, so if you have 30 employees in your companies, you’ll need about 3 computers right there, just to get work done and you’ll probably want a separate computer for a web server, one for a database server and so on.
Usually, as a sysadmin you pick a naming theme like maybe Greek gods, or wild animals or something and then you name each of the computers with some unique name that relates to that theme. So for example you might have
cobra.wonderwidget.com or possibly
athena.wonderwidget.com. In this way you know that each of these names is a separate computer owned by Wonder Widget, LLC and in the same network. Also, usually when you’re in the office, on the corporate network, you can simply use the subdomain of the computer you want to contact, so for example you could
ping cobra or
ping zeus as opposed to typing out the whole thing like
With A Regular Domain Name
Regarding domain names, if you’re reading this, chances are likely that you were reading another tutorial here that wants to be sure you know how to and that you should set up a domain name along with canonical hostname that belongs to that domain. For example
foo.mysite.com as a canonical hostname of the domain
Always make up a subdomain to refer to your master server, something that fits your naming scheme, like
jupiter.wonderwidget.com if you use planets or
aquarius.wonderwidget.com if you use Zodiac signs. Edit your zone file and add an A record for your subdomain so that it points to the IP of your email server. Note: a lot of things won’t work so well if you’re just using
wonderwidget.com, you will want to use a subdomain like
foobar.wonderwidget.com because this is how the Unix utilities are built to work.
Setup a Dynamic Domain Name
If you don’t have a domain already or don’t know how to edit your zone file to add A records, I highly suggest getting an account at DynDNS where you can get dynamic domain names that are free and easy to edit.
If you go with dyndns then you should enable the wildcard(s) when you create your domain. In the dyndns control panel for each domain name, there is an option to allow wildcard domains such as
*.wonderwidget.dyndns.org. Now choose a name at random to be what is called the canonical hostname and remember it in your head. Generally in the examples on this site, the canonical hostname is
rainmaker.wonderwidget.dyndns.org is the name I choose to think of as canonical.
Why do this you ask? That’s just the way it is – or so says that song. But seriously, that’s just the way unix is and that’s the kind of setup it wants, so use it. Don’t worry you can configure other domains like
www.wonderwidget.com later. For now set your server up as if there were no wildcard on your domain and you must only use either your canonical hostname or your domain name.