Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Assume an environment with a puppet-managed cluster of different servers - various hardware, software, operating systems, virtual/dedicated, etc.

Would you choose meaningful hostnames (mysqlmaster01..99, mysqlslave001..999, vpnprimary, vpnbackup, etc.) or would you prefer meaningless hostnames such as characters from a book or movie?

The problem I see with meaningful hostnames is that names usually represent a single service and if a server has more than one purpose it gets really messy (especially if server roles change often).

Isn't mapping a service name to an IP address and maintaining that mapping what DNS is supposed to do?

What are the advantages and drawbacks of both approaches and what actual problems have you had to tackle with the approach you chose?

share|improve this question
10  
If you control DNS, you can can always do both. –  jscott Feb 18 '13 at 14:05
    
@jscott true, i do want to use DNS for service<->ip mapping but question is about naming actual hosts - that's where i'm in doubt –  keymone Feb 18 '13 at 14:06
16  
I'll just leave it here: RFC 1178 –  gelraen Feb 18 '13 at 14:17
    
see also serverfault.com/search?q=naming%20conventions –  warren Feb 18 '13 at 18:06
2  
At the risk of seeming self-interested, I agree; I think the feedback on the question makes it clear that the wider community sees value in it. –  MadHatter Feb 19 '13 at 10:34

6 Answers 6

up vote 89 down vote accepted

Once upon a time I had an opportunity to decide on a naming scheme. So I went round and asked my developers, who after all were the people who had to work with these names on a day-to-day basis, whether they preferred functional names (that is, names which represent, in some encoded form, the purpose of the machine) or mnemonic names (that is, names drawn from some pre-existing human naming scheme, which contained no implicit content about the machine's purpose).

Out of 38 developers, 37 preferred mnemonic names; only one preferred functional names. So I named them all after rivers (there's a very large pool of possible names, and many of them are short, easy to remember, and quick to type).

The human brain is pretty well-designed for attaching meaning to names. If you provide names that are memorable, people will pretty quickly remember what those names are used for, and use them. If you use names drawn from some common background (eg rivers, elements, stars, counties, drinks, you get the idea) it helps people to immediately recognise a company hostname when they come across it; otherwise statements like "all the email ended up on betelgeuse" can be a bit confusing).

Conversely, my developers felt that they had in previous jobs had a really hard time remembering exactly what pr1ms001 was.

But I should add that we used CNAMEs in the internal DNS to provide a functional name to mnemonic name mapping, so if you really found it easier to remember that the main mail server at the first cluster at the PR site was pr1ms001, then the DNS would let you know that that was currently orwell. Also, that let us have many functional names per machine, so as long as you always used the functional name relevant to the function you were working on, you could be sure that pr1imap001 would always point to the IMAP server, even if we moved that functionality from orwell to rhine. And when hudson died, we could change the name of the replacement without affecting operational functions, so that we never had the "do you mean new hudson or old hudson?" confusion.

share|improve this answer
6  
You might think that, but my developers said that the mnemonic scheme was better whether or not anything much else was communicated, because they all built their own internal state tables of what was where, and that sort of memory is easier to build on names that the human brain likes to remember. –  MadHatter Feb 18 '13 at 14:25
2  
+1 to the idea of using both internal names and mnemonic reference names. –  Insomnia Feb 18 '13 at 18:40
3  
+1 for the science :) –  Michael Kjörling Feb 18 '13 at 19:45
7  
You should have named them after volcanoes in Iceland. –  Chloe Feb 20 '13 at 4:50
1  
This is an awesome idea, and I'm stealing it. –  SpacemanSpiff Feb 28 '13 at 2:13

This largely comes down to whether your servers are pets or livestock.

Pets get individual names. They're distinct from each other, and we care about those differences. When one gets sick, we usually try to nurse it back to health. Traditionally, servers have been pets.

Livestock get numbers. They're mostly identical, and what differences there are, we don't care about and usually try to minimize. When one gets sick, we put it down and get another one. Fully virtualized servers, especially IaaS servers such as AWS, are livestock.

In most complex environments, you have a mix. Your web backends, for instance, are almost certainly livestock. If you need more, you spin up a few more with the standard config; if you don't need as many you turn some off. Your database servers, in some configurations, are pets. There may be a lot of special setup on each; you may even be running them on bare metal instead of virtualization.

Of course, in either environment, you can name SERVICES and address those directly. This is a best practice in any case; your developers shouldn't need to know or care what the actual hostname of a service is. The hostname should be a purely operational detail. Think, then, of encoding information that is useful to your ops staff in the hostnames - for instance, it's often helpful to denote which datacenter a server is in.

share|improve this answer
17  
Pets or livestock - that's a nice way to put it. –  Michael Hampton Feb 18 '13 at 21:17
2  
I recently re-found the article that I first saw this concept in: gregarnette.com/blog/2012/05/cloud-servers-are-not-our-pets –  Ian May 6 '13 at 20:16

This has been covered here before...

My recommendation is a combination of functional names and mnemonic names...

If you're writing an application and it needs to address ccts-logserver1, use that name throughout, but make that a CNAME or an alias. The real hostname can be whatever you want: a fruit or vegetable, greek mythology or Seinfeld character... but it gives you some flexibility when you need to associate real functional names, but keep something that people can remember.

Think of the example where mango, the DB server fails... but is replaced with something else, say peach. Perhaps existing processes and applications need to see cmt-prod-db1. You can swap the systems, build them without naming conflicts and keep the applications (and developers) happy.

share|improve this answer

Where I work we manage multiple sites, multiple companies, in multiple cities. For us mnemonic names can't work. Instead we use a shorthand form that describes our servers. This works well in our case as we have some clients which may have multiple offices on different domains (or a single office on multiple domains, or multiple offices on the same domain, or all of the above!)

For us, the information contains Company/Domain, city, function, number. So for a domain controller for company, say Cypress in Chicago it would be:

CYPRCHDOM001 (We would refer to this as Cypress main DOM in conversation)

CYPRCHSQL001 would be it's SQL server, CYPRCHMGM001 would be its management (ie, anti-virus, backups, etc), and CYPRCHAPP001 would be a mixed applications server. Easy to remember, easy to sort, easy to teach.

share|improve this answer
1  
So how do you remember what applications run on CYPRCHAPP001 as opposed to CYPRCHAPP003? I'll admit this is a problem with mnenomic names as well, but if you're going for some kind of functional names, might as well be specific. –  Michael Kjörling Feb 18 '13 at 19:44
2  
@MichaelKjörling Fine grain specifics of what is on a server don't belong in a name, they belong in some sort of documentation. If someone needs to know what is running on CYPRCHAPP001, they read the documentation. Besides applications move, CYPRCHAPP001_PointofSale_Payroll_HRSoftware-etc will be a misnomer when the company moves their payroll software to a hosted solution. –  Wulfhart Feb 19 '13 at 23:17
2  
@Wulfhart I agree with your point, but what's wrong with having CNAMEs for pointofsale, payroll, etc.? That way, nobody but the sysadmins need concern themselves with exactly where the payroll software is running; for everyone else, it just works. Want to move something to another datacenter? No problem at all. Want to move the point of sale system database to its own dedicated server? Just update the pointofsale-database CNAME to point to the new location. And so on. –  Michael Kjörling Feb 20 '13 at 8:47
1  
Suppose you need to replace a machine: once you've built CYPRCHSQL002 and tested it, do you just retire the name CYPRCHSQL001 (never to be replaced), or do you rename 002 to 001 after you've removed the old 001, or something else? –  nickgrim Feb 20 '13 at 11:22
    
@MichaelKjörling That seems like a great idea to me. By "specifics don't belong in a name" I meant not in the machine's hostname. –  Wulfhart Feb 20 '13 at 22:39

The only requirement for hostnames is that they should be unique on the network.

The meaning doesn't have to only be to do with the servers function. Location can be very useful if you have to deal with physical devices. Knowing if a device is virtual or physical can also be useful. Being able to tell the difference between a network device, a linux server or a windows box can be very handy when it comes to figuring out what tool to use to login.

The way we handle it is to try and put this information into the device name as follows:

L or T - Live or Test P or V - Physical or Virtual S or N - Server or Network (we don't have any Linux servers) a sequential number to ensure uniqueness An ISO 3166-1 three letter country code indicating where the device is located.

We then use CNAMES in DNS to map various service names through to the hostname.

I have mixed feelings about this. It certainly saves time in having to look up where a certain device is located. On the other hand it is much harder to remember what a given server does when presented with its hostname, when compared to our previous system which used gemstones. The gemstones didn't imply any meaning at all, but they were easy to remember because each person could create their own connections.

I guess the only advice would be to settle on one schema as the greatest confusion arose when we transitioned from one system to the other.

share|improve this answer
    
I do disagree with this : "Knowing if a device is virtual or physical can also be useful" in the context of a naming discussion. Of course it's useful information, but it's not the first thing you need to know about a server from reading its name. Further, P2V or V2P either breaks your scheme, or requires renaming of the server, which may break other things. –  mfinni Feb 19 '13 at 15:38
1  
In my experience P2V or V2P breaks a whole bunch of things and should be avoided where possible - we do, hence it isn't an issue with our naming convention. The naming convention needs to meet the requirements of whoever designed it - in the org I work in it was designed by the team who manage all the servers and network equipment, and they want to be able to tell the above things. It might not be right for you, but then it is all open to debate. The only technical requirement is uniqueness. –  dunxd Feb 20 '13 at 12:46

This is personal preference, really. Myself i tend to name all my devices by mythology-ish names, not real ones but totally sound alike.

For example: Smartphone: Grotor
Smartphone: Gretche

Netbook for family use: Massiah
Personal notebook: Brutus

but then again, i do not own 100 servers, but in theory, if i would i'd call them like that:
I'd group servers and call separate server groups in different styles, like different episodes character names or different stylistic.

I believe that hardware deserves to get to have a name.

share|improve this answer
3  
That's great, really. How proud you must be. However, around here, we like answers to be substantive, based on facts/quantifiable evidence, and not to be a simple statement of opinion or what you think is cool. Also, this is a site for IT professionals acting in a professional capacity, so what you name your netbook and/or the family PC are not relevant here. –  HopelessN00b Feb 28 '13 at 0:50
1  
But you have to agree that this question is not really technical; –  David Aizenberg Feb 28 '13 at 0:51
1  
"Technical" is not a synomym for "professional." It's a relevant question for IT professionals, regardless of how "technical" you feel it is. –  HopelessN00b Feb 28 '13 at 0:54
1  
You're referring to "Professional" so much. If I am student, and do not really have access to real world servers just yet, I can not write on this website or what? The question is about hostname choosing and I have provided my naming pattern, it is used for home use tech for now, and will most likely be used in future when I get to work with real servers. ~Sincerely, Localhost admin. –  David Aizenberg Feb 28 '13 at 0:57

protected by HopelessN00b Feb 28 '13 at 0:45

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.