If you're going to be naming a lot of computers, it's surprisingly important to pick a naming format that is (1) expandable and (2) trivially parseable. The naming scheme that seems simple when you're in a garage can be constraining when there's too many to track in a spreadsheet.
My favored format is somewhat complex in terms of layout, but is compact and easy to read once you get used to it:
IATA code (https://en.wikipedia.org/wiki/IATA_airport_code)
Cluster number (digits)
'r' (for "rack") \______ if meaningful for you
Rack number / (ignore for EC2/GCP)
'm' (for "machine")
Machine number
An example hostname might be `dls1r56m10.mycompany-prod.com`.
Alternatives that don't work as well:
* Don't use a fixed-width field anywhere. Google used two-letter cluster names, and when those ran out they discovered that the two-letter assumption had worked its way into every layer of the stack. One of the important core services had `uint16_t cluster` in its wire protocol.
* Don't make up your own cluster names. Don't use names like "northwest" or "east". IATA codes are your friend and you will love them because someone else already decided what they should be and wrote them down.
* Don't use fields without delimiters. Being able to say "read digits until the next non-digit" is incredibly useful when writing ad-hoc parsers in shell scripts, because those parsers won't break when you bring up the first datacenter with more than 99 racks. If you tell people not to write hacky ad-hoc parsers in shell scripts, they will (1) do so anyway and (2) not tell you.
* Don't leave off the cluster number. Yes, you only have one cluster in us-west-2 right now, but maybe in five years you'll need to have more than one because you want to run 30,000 EC2 instances there but all your per-cluster infrastructure software falls over at 20,000 instances. Then you can just turn up "pdx2" instead of trying to explain to Hashicorp engineers why you want to run the world's biggest Consul cluster.
* Do not put the production hostnames under a subdomain of your corporate website. If you are ACME LLC then your hostnames should end with `.acme-prod.com` instead of `.prod.acme.com`. The same is true of corporate IT assets like laptops or workstations (`acme-corp.com` -- NEVER `.corp.acme.com`). Why? Browser cookies.
+1 for airport codes. I was surprised to learn about this convention which seems to be used by many CDNs when I first started working for Netflix, but it makes a huge amount of sense.
Now if I just had a dollar for each time I've fat-fingered sjc002 to scj002 ... :)
The IATA code thing seems a bit wobbly. Am i really going to sit and work out if our datacentre in Sutton is closer to Heathrow or City airports?
We name our datacentres with a two-letter city code and a digit (or some letters and then some digits in your framework!). The city codes aren't from any canonical list, but it turns out there aren't enough to matter. So far, this has served equally well at avoiding arguments about what to call things.
We name machines ${datacentre}-${other_stuff}. That makes it trivial to tell what exact datacentre a machine is in. That's very nice if you have to reason about networking. In your scheme, if you had multiple datacentres near one airport, you would have to know the mapping from cluster to datacentre, right?
Including location detail in the name would only seem appropriate for massive operations which include slow and methodical procedures for changes. Otherwise you would end up moving servers and now having names which incorrectly suggest their mount positions.
When naming "pets", thematic names are nice: Tolkien characters, words-starting-with, deities, elements, plants, animals, etc.
When naming "cattle", schemes that have fairly intricate coded meanings and numerical elements generate things like LDW21-0743 (London, Desktop, Windows, 2021, number 743).
Somewhere between 50 and 100 machines and you need to transition, and it can be surprisingly traumatic.
We have a greyhound, and they are closer to cattle than pets at the beginning of their lives. Each dog has a unique combination of numbers tattooed in their ears. Then they are named according to a weird convention where litter-mates share a "first name" while having their own unique "second name". For example, my greyhound was named Del Sol Madison, and she had litter mates with names like Del Sol Martin, Del Sol Maxine, etc. These names are used for identifying the dogs, but they are not trained to respond to them because they aren't pets. Once we got her, we called her Maddie and that's just been her name ever since.
When I worked at NASA, I basically did both. We had fixed format official "cattle" names that included the organization code and the computer's inventory number. Those names were useless to humans, so I always also registered a human-friendly "pet" alias. It was a bit more trouble, but it generally worked well. The pet names also has some structure, with prefixes differentiating classes of systems (desktop, server, lab), but they were otherwise free-form and picked to be useful to the users.
I use porn star names to name computers in my company network.
It's easy to claim that "lisaann" and "peternorth" are just randomly invented names, and then watch some corporate drone blushing and struggling when asked to explain why they find those names inappropriate.
If I'd notice that thing I would probably just silently judge you and file you into the "immature edgy teenager"-category and avoid giving you any meaningful decisions from now on.
Big yikes, that's a hostile work environment and is a huge risk for your HR I am sure. I would not be comfortable working with such conditions, and would be sure to let my HR rep know.
I would argue metadata does not belong in a device name. Location, OS, etc., should all be tracked in the device management system.
The impulse to encode lots of metadata in a device name is reasonable, but less is more. Location, user, application, even OS can all change. What then does it mean for the device name?
And how often do you need to distinguish between a laptop and a desktop, really?
Name things uniquely, and as little beyond that as possible. If the system generates its own unique default (Windows) or manages its human-readable hostname on its own (Mac), use that. Let your device management tools tell you where it is, what model device it is, what OS it runs, etc., not to mention countless other things you’ll never fit in a name.
I used to make exceptions for infrastructure, but with automated network management tools, I don’t even bother with that anymore. All that matters is that a device is represented in a database by a primary key, and I don’t even care what that is.
The best naming convention is not to bother with conventions at all. Let the machines do that work.
The first big Unix workstations site I worked at, at the same time as this RFC, the head sysadmin started naming SPARCstations after vacation destinations she liked (`cozumel`, `stcroix`, etc.).
I guess it brightened up the all-gray cubicle farm.
My hostname idea was to name network printers after trees (e.g., `pine`, `elm`).
You can also make the hostname work with the FQDN. I once got the hostname `ilove.mit.edu`. I later got them to rename it to `ihavealovehaterelationshipwith.mit.edu`.
Growing up, my dad named all his computers after native trees and plants where we were living. (e.g. Redwood) I’ve carried on doing that! Currently the main computers in the house are Cottonwood, Prickly Pear, Hackberry, and Honeylocust.
For people that likes to stay in a given theme: I worked in a company that was using pokemon names for hostnames. Given there seem to be close to a thousand of them now, it's probably not such a bad idea for a small network where you don't expect more than a few hundreds host at a given time.
Mildly recursively, when I play at trying to name all the elements[1] in fifteen minutes, I think of the sets of things elements are named after. Geographic places (Europium, Londinium, Americium, Californium), laboratories (Berkelium, Lawrencium), people (Einsteinium, Nobelium, Curium, Seaborgium), astronomical things (Helium, Selenium, Plutonium, Uranium, Mercurium), things known in the ancient world (Silver/Argentum, Lead/Plumbum)... although it's never enough for me to get all of them.
I would also recommend picking a system with a sizable pool of options. Naming my computers after the planets seemed like a fine idea, until you start living with someone and start adding Raspberry Pis and other devices around the home. Eight planets didn't quite cut it, and now I have an odd mix of mythological characters.
When you only have a few computers to manage, have fun with names. But when you start to have hundreds (or thousands) of computers, you really need a naming convention. At that point, you're dealing with multiple environments, locations and business units. Being able to glean that information from a name is very helpful.
Also, at that scale, names are never permanent. You're renaming (or rebuilding) hosts as they change location and usage.
The worst is when you scale up from a small firm where all the hosts are named after movie characters and all services are hard coded to those names. Been there, its rough....
One place we named all the (Unix) machines with names beginning with a 'C': cbed, cnic, cweed, csun (a Sun box, of course!), cmen,... We were (obvs?) developing in C, and our office was known in the company as "C-centre". All seemed to make sense at the time.
A rare gem. Now cue all the people, not having read it, chiming in with comments of the form “What I use is… [something which the RFC recommends against doing]”.
I name for expected performance. A remote server named Arnie should be strong, reliable and always come back. A music server named Elvis serves music with elements from multiple genre and not mind being told what to do by someone who knows a lot less about how it does what it does (that'd be me) than it does. A back-up server named Methuselah should not die for a very, very, very long time. So far, it's been a successful scheme.
I like tying the scheme to the domain. For instance, mine has always been starfleet.mil. Forever non-public domain. Lots of options for host names. (I've never been able to figure out a cohesive way to do this for Star Wars.)
If you were going for deities, maybe olympus.<something> for Greek gods. Wherever the pantheon is supposed to be homed. Hinduism would give you more host names than you could (probably) ever use...
Your mentioning the pantheon gave me a flashback to how one of my old companies named their non-prod environments. The dev environment services were named after all the Greek gods, and the QA/demo environment services after the Roman gods. It was so horribly confusing…
.mil is an valid (restricted) tld [0], and has been for a long time. And while starfleet.mil is still currently unregistered, I wouldn’t be surprised if they changed given recent trends [1]…
I'm sure it works fine, but .mil is a real TLD and someone (like the new Space Force or whatever they call themselves) could register it and use it publicly tomorrow.
Before I started using zfs and drive names stopped mattering, I'd name my personal storage drives after heroes from the Iliad, and the corresponding backup drives after the heroes' wives.
I intentionally violate this RFC for workstations and laptops. Some applications leak client hostnames to remote servers. I prefer to keep it bland. For public servers I would say I am in alignment and would only add I keep server names and domain names programmatic, short and simple enough for anyone inebriated to type. It's worked out well thus far.
Some of my machines are references to LoadingReadyRun's Installation Anxiety[0][1] sketch. When I was in college ~15 years ago, I built a file server, so I named it toilet. I eventually put a web server on it too, and when I replaced the hardware, I named it gram, but my blog code still retains the old name[2]. And yes, I named my router dishwasher.
I'm dead set against IoT, so naming my computers after fixtures or appliances hasn't caused conflicts.
[+] [-] jmillikin|2 years ago|reply
My favored format is somewhat complex in terms of layout, but is compact and easy to read once you get used to it:
An example hostname might be `dls1r56m10.mycompany-prod.com`.Alternatives that don't work as well:
* Don't use a fixed-width field anywhere. Google used two-letter cluster names, and when those ran out they discovered that the two-letter assumption had worked its way into every layer of the stack. One of the important core services had `uint16_t cluster` in its wire protocol.
* Don't make up your own cluster names. Don't use names like "northwest" or "east". IATA codes are your friend and you will love them because someone else already decided what they should be and wrote them down.
* Don't use fields without delimiters. Being able to say "read digits until the next non-digit" is incredibly useful when writing ad-hoc parsers in shell scripts, because those parsers won't break when you bring up the first datacenter with more than 99 racks. If you tell people not to write hacky ad-hoc parsers in shell scripts, they will (1) do so anyway and (2) not tell you.
* Don't leave off the cluster number. Yes, you only have one cluster in us-west-2 right now, but maybe in five years you'll need to have more than one because you want to run 30,000 EC2 instances there but all your per-cluster infrastructure software falls over at 20,000 instances. Then you can just turn up "pdx2" instead of trying to explain to Hashicorp engineers why you want to run the world's biggest Consul cluster.
* Do not put the production hostnames under a subdomain of your corporate website. If you are ACME LLC then your hostnames should end with `.acme-prod.com` instead of `.prod.acme.com`. The same is true of corporate IT assets like laptops or workstations (`acme-corp.com` -- NEVER `.corp.acme.com`). Why? Browser cookies.
[+] [-] throw0101c|2 years ago|reply
UN/LOCODE may be more appropriate:
* https://en.wikipedia.org/wiki/UN/LOCODE
* https://unece.org/trade/cefact/unlocode-code-list-country-an...
Has both country code and location with-in that.
[+] [-] drewg123|2 years ago|reply
Now if I just had a dollar for each time I've fat-fingered sjc002 to scj002 ... :)
[+] [-] twic|2 years ago|reply
We name our datacentres with a two-letter city code and a digit (or some letters and then some digits in your framework!). The city codes aren't from any canonical list, but it turns out there aren't enough to matter. So far, this has served equally well at avoiding arguments about what to call things.
We name machines ${datacentre}-${other_stuff}. That makes it trivial to tell what exact datacentre a machine is in. That's very nice if you have to reason about networking. In your scheme, if you had multiple datacentres near one airport, you would have to know the mapping from cluster to datacentre, right?
[+] [-] tambre|2 years ago|reply
What do you do if there's no airport?
[+] [-] unknown|2 years ago|reply
[deleted]
[+] [-] michaelteter|2 years ago|reply
[+] [-] infogulch|2 years ago|reply
Is there more to say about this? How do browser cookies conflict with server and PC hostnames?
[+] [-] lloydatkinson|2 years ago|reply
[+] [-] GoblinSlayer|2 years ago|reply
[+] [-] __d|2 years ago|reply
When naming "pets", thematic names are nice: Tolkien characters, words-starting-with, deities, elements, plants, animals, etc.
When naming "cattle", schemes that have fairly intricate coded meanings and numerical elements generate things like LDW21-0743 (London, Desktop, Windows, 2021, number 743).
Somewhere between 50 and 100 machines and you need to transition, and it can be surprisingly traumatic.
[+] [-] schwartzworld|2 years ago|reply
[+] [-] rootbear|2 years ago|reply
[+] [-] kbob|2 years ago|reply
[+] [-] amelius|2 years ago|reply
[+] [-] miroljub|2 years ago|reply
It's easy to claim that "lisaann" and "peternorth" are just randomly invented names, and then watch some corporate drone blushing and struggling when asked to explain why they find those names inappropriate.
[+] [-] atoav|2 years ago|reply
[+] [-] mypastself|2 years ago|reply
No blushing is required.
[+] [-] urda|2 years ago|reply
[+] [-] nly|2 years ago|reply
[+] [-] unknown|2 years ago|reply
[deleted]
[+] [-] fknorangesite|2 years ago|reply
[+] [-] TRiG_Ireland|2 years ago|reply
[+] [-] p0pcult|2 years ago|reply
[deleted]
[+] [-] jl6|2 years ago|reply
[+] [-] jmbwell|2 years ago|reply
The impulse to encode lots of metadata in a device name is reasonable, but less is more. Location, user, application, even OS can all change. What then does it mean for the device name?
And how often do you need to distinguish between a laptop and a desktop, really?
Name things uniquely, and as little beyond that as possible. If the system generates its own unique default (Windows) or manages its human-readable hostname on its own (Mac), use that. Let your device management tools tell you where it is, what model device it is, what OS it runs, etc., not to mention countless other things you’ll never fit in a name.
I used to make exceptions for infrastructure, but with automated network management tools, I don’t even bother with that anymore. All that matters is that a device is represented in a database by a primary key, and I don’t even care what that is.
The best naming convention is not to bother with conventions at all. Let the machines do that work.
[+] [-] modderation|2 years ago|reply
[1] https://www.rfc-editor.org/rfc/rfc2100
[+] [-] neilv|2 years ago|reply
I guess it brightened up the all-gray cubicle farm.
My hostname idea was to name network printers after trees (e.g., `pine`, `elm`).
You can also make the hostname work with the FQDN. I once got the hostname `ilove.mit.edu`. I later got them to rename it to `ihavealovehaterelationshipwith.mit.edu`.
[+] [-] Vpr99|2 years ago|reply
[+] [-] sgtnoodle|2 years ago|reply
[+] [-] digging|2 years ago|reply
I like that scheme. I find it meaningful to name things in my life after things in my natural environment. Helps me remember that I exist inside it.
[+] [-] nonethewiser|2 years ago|reply
[+] [-] lelag|2 years ago|reply
[+] [-] nbk_2000|2 years ago|reply
[+] [-] jodrellblank|2 years ago|reply
Mildly recursively, when I play at trying to name all the elements[1] in fifteen minutes, I think of the sets of things elements are named after. Geographic places (Europium, Londinium, Americium, Californium), laboratories (Berkelium, Lawrencium), people (Einsteinium, Nobelium, Curium, Seaborgium), astronomical things (Helium, Selenium, Plutonium, Uranium, Mercurium), things known in the ancient world (Silver/Argentum, Lead/Plumbum)... although it's never enough for me to get all of them.
[1] https://www.sporcle.com/games/g/elements
[+] [-] aquova|2 years ago|reply
[+] [-] SkipperCat|2 years ago|reply
Also, at that scale, names are never permanent. You're renaming (or rebuilding) hosts as they change location and usage.
The worst is when you scale up from a small firm where all the hosts are named after movie characters and all services are hard coded to those names. Been there, its rough....
[+] [-] mikro2nd|2 years ago|reply
[+] [-] hdjjhhvvhga|2 years ago|reply
Obviously programming in C wasn't your only favorite pastime.
[+] [-] teddyh|2 years ago|reply
[+] [-] ncarroll|2 years ago|reply
Edited for missing words.
[+] [-] TheRealDunkirk|2 years ago|reply
If you were going for deities, maybe olympus.<something> for Greek gods. Wherever the pantheon is supposed to be homed. Hinduism would give you more host names than you could (probably) ever use...
[+] [-] goodells|2 years ago|reply
[+] [-] pimlottc|2 years ago|reply
0: https://en.m.wikipedia.org/wiki/.mil
1: https://www.spaceforce.mil/
[+] [-] kjs3|2 years ago|reply
The ".home.arpa" domain is explicitly set aside for 'home' non-public networks in https://datatracker.ietf.org/doc/html/rfc8375.
[+] [-] yamtaddle|2 years ago|reply
[+] [-] lightspot21|2 years ago|reply
[+] [-] LinuxBender|2 years ago|reply
[+] [-] aftbit|2 years ago|reply
tron, finch, wintermute, sparrowhawk, axolotl, rook, moneta, mengpo, odessa, ithaca, turing, lovelace
[+] [-] theandrewbailey|2 years ago|reply
I'm dead set against IoT, so naming my computers after fixtures or appliances hasn't caused conflicts.
[0] https://wiki.loadingreadyrun.com/index.php/Installation_Anxi...
[1] https://www.youtube.com/watch?v=ajW2fDy41fY
[2] https://github.com/theandrewbailey/toilet