Tech/Basics/Hostname Naming Convention
Hostnames
A hostname can have a naming convention that is useful and predictable. I am the author of the Product Naming Conventions on Wikipedia so I take it maybe too serious. Hostnames are typically the names of physical hosts but in this modern age can be the names of virtual hosts. A DNS address can be the name of an endpoint or service as a host can have multiple IP addresses.
Exmaple
One pattern I worked on was for Tecnoera in Chile who was using Egyptian historical names originally
TCN-LON-VPN15.TECNOERA.COM
So as an IXP they needed to note the ownership, the location and the purpose so we have
- TCN
- Tecnoera
- LON
- Datacenter on Londres in Vina Del Mar
- VPN15
- The 15th VPN
Later in the process we added a geographical region as we had locations in various countries
TCN-05-LON-VPN15.TECNOERA.COM
- 05
- Chilean Region 5 is the common usage for the Valparaiso region (not to be confused with the city by the same name)
As adoption of this name also found its way into other customers and providers it became an accidental standard in Chile
Further the benefit became obvious after you see a series of hosts.
TCN-LON-VPN1.TECNOERA.COM TCN-LON-VPN2.TECNOERA.COM TCN-LON-VPN3.TECNOERA.COM TCN-LON-DNS2.TECNOERA.COM TCN-LON-VPN4.TECNOERA.COM TCN-LON-VPN5.TECNOERA.COM TCN-LON-VPN6.TECNOERA.COM TCN-LON-VPN7.TECNOERA.COM TCN-LON-VPN8.TECNOERA.COM TCN-LON-VPN9.TECNOERA.COM TCN-LON-VPN10.TECNOERA.COM
Notice how easy it is to read even with the DNS2 hidden in the list
Suggestion
- owner-region-type-serial.hosts.domain.tld
Hostname
IBM-ORD-PVH-002
Hosts Domain
HOSTS.DOMAIN.TLD
FQDN
IBM-ORD-PVH-002.HOSTS.DOMAIN.TLD
Here we have an IBM owned system in Chicago that is a Physical Virtual Host with Serial number 002
Owner
Noting the owner can be important. It can be the owner of the hardware or the company or group using it. The idea is that users should expect the prefix for a naming convention.
Region
IATA airport code for industry standard, use another if desired, assume use of a system of record for exact location discovery
- hosts prefix enables fast visual identification even by newb
- Pick a standard and stick to it.
Type
We can look up more details in the system of record if needed like the exact rack location.
- PVH being a Physical Virtual Host
or
- PSW being a Physical Network Switch
Others:
- PRT being a Physical Router
- PLB being a Physical Load Balancer
- PDS being a Physical Data Store
- * (Use FS for file store or ST for storage, just keep it simple)
Serial
000-999 Offers almost 1000 hosts and is speakable
or
(A-Za-z0-9) G6y
G6y is a 62 bit encoded value that uses the 26 alphabet upper and lower case and the numeral digits from 0-9
G6y == 6 58 50
- Note
- Don't use https://en.wikipedia.org/wiki/Base64 as the + and / are not valid in DNS
- Strip out the confusing chars like 0, O, o, I, l, 1, for 23456789abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ
- Just alphabet chars gives 26 variations to the power of 3 so 17576 possibilities