What is a _memorable_ "servername" exactly?
Unfortunately I am not quite sure what Sam Kleinman refers to when he writes memorable. Could I call the "servername" anything I desire?
Prior to that the tutorial states that one should replace "servername.domain.tld" with Linode's fully qualified domain name (FDQN).
Currently I am using "lixx-yyy.members.linode.com" as my FDQN in /etc/hosts, where xx likely represents the server number, and yyy represents the last 3 digits of the static IP address.
Is this correct? If not, what should one be using for "servername.domain.tld"?
Does one have the freedom to name "servername" anything I like in /etc/hosts? For example, can one use any registered domain name as "servername", or is it far more arbitrary?
Thanks for the help.
11 Replies
Ok not really.
Pretty much any name will do.
Try "Sparky", I've always had really good luck with that name.
RFC 1178
In short, every computer should have a hostname and it must be unique and unambiguous within your context. Or you'll go batty.
So, barring machines that are physically embedded in other devices, semantically neutral, easy-to-remember-and-spell names are best. You can do this thematically (though as with the individual machines, do not count on the name making "sense" over time. e.g.: all machines in location X are named for types of toads, but machine Y is moved to location Z and now is a toad in a place no toad should be.)
Avoid names that are confusing when spoken. If you are English speaking and choose French names you will find that you are constantly forced to spell the machine's name after saying it, and, even with that precaution, you will get email (long after the initial contact and just before an important deadline) saying the machine doesn't answer. Make names shortish, and don't try to embed information in them, use a database to track them.
Now, on virtual host names, these are NOT machine names. They are truly functional names. If you are creating a virtual host for a web server, you are creating something that is for a particular purpose. It is not tied to a physical machine (it can be moved easily to a completely different hosting arrangement). It is designed to provide access to a category of information or a particular service.
So, here, you WANT a semantically effective name. It should be named for what the user will find when they type that address into the location bar of their browser. It should inform the human being about what will be there and be easy to remember and even to derive if the user is knowledgable.
So, for a virtual host, use a meaningful name. "Memorability" is a laudable quality but it comes from a complex of attributes. It is very easy to remember things that make sense. Since a virtual host name does NOT have to be unique outside the namespace defined by the rest of the FQDN, you don't have to concern yourself with confusion outside your enterprise. Just choose something that means something most useful about the virtual host.
For example, if the host is a place for a particular user to provide general web services to his audience,
If the host is for a particular function of the organization running the web server, name it for that. (e.g.: blog.domain.tld and forum.domain.tld).
The main idea in all of this is to note that you are dealing with a hierarchical naming system where the names are sometimes tied to physical objects and sometimes to virtual ones. Imagine HOW the name will be USED and choose accordingly.
Also, "binky" is a good name.
For newer machines, I'm currently using the names of planets from the Star Wars universe. My linode is hoth, and my home file server is yavin (because, you know, gas giants are large, and 10TB is kinda large for a home file server).
While I understood the general idea "Names, like words, have meanings based on use" described so eloquently by Yaakov and supported by RFC 1178, I was still unclear on the mechanics of how to modify the /etc/hosts file, specifically the allowable syntax. Originally I failed to convey precisely the nature of my inquiry which was more syntactical than lexical or semantic. Thanks Yaakov for providing a clue in that direction by mentioning that a virtual host does not have to be unique outside the namespace defined by the rest of the FQDN. I agree - "binky" is a great name, as in "binky" has crashed.
In the process of trying to get ISPConfig to run on port 8080 per the Linode tutorial ([http://library.linode.com/web-applications/control-panels/ispconfig/ubuntu-10.04-lucid[http://www.linode.com/forums/viewtopic.php?t=5518&highlight=ispconfig
Unfortunately the solution offered in the URL above, and repeated below, still fails to address the question of how to modify the hosts file syntactically.
* * Change hostname to 127.0.0.1
* Update your hostname to something more meaningful
* Set up a reverse DNS using Linode manager
* Enable .htaccess acess
* Add AllowOveride All or AllowOveride Options to VirtualHost</list>
The Dashboard of the Linode Manager allows one to change the Linode Label to a meaningful name in much the same way one is recommended to change the hostname.
* * Must the Linode Label match the hostname/servername in the /etc/hosts file?
* Can they be different with no adverse effects?</list>
Page 14 of the O'reilly Linux System Administration book suggests the following for the /etc/hosts file.
127.0.0.1 localhost.localdomain localhost server1
70.153.258.42 server1.centralsoft.org server1
On 2010-08-05 my /etc/hosts file looked like this.
127.0.0.1 lixxxxxx localhost
74.xxx.xxx.xxx
During a support ticket exchange, Linode's Stan recommended that I leave the 127.0.0.1 as the following.
127.0.0.1 localhost
This is the current state of my /etc/hosts file.
127.0.0.1 localhost
74.xxx.xxx.xxx lixxxxxx.members.linode.com lixxxxxx
And for reference here is my /etc/hostname file.
lixxxxxx
lixxxxxx.members.linode.com
So my new questions are these.
* * Must the hostname be listed once a FQDN, "servername.domain.tld" in the /etc/hosts file?
* Must one use linode.com as the "domain.tld" in the /etc/hosts file, for example, making the FQDN in the file "blinky.linode.com"?
* Can one use one of the registered domain names in the /etc/hosts file, for example, mydomain.com?
* If one plans to launch a multi-site virtual host configuration, can one arbitrarily choose one of the registered domain names for the /etc/hosts file, or must each registered domain name be accounted for in both the /etc/hosts file and the /etc/hostname file?
* Would the FQDN in the /etc/hosts file using a registered domain name look something like this: blinky.mydomain.com?
* Both user ops and the O'reilly book appear to indicate that the hostname should be assigned to 127.0.0.1\. However, Linode's Stan recommended that the 127.0.0.1 line only reference localhost, removing my prior hostname reference. Must localhost appear prior to the hostname on this line?</list>
Thank you.
127.0.0.1 localhost
127.0.1.1 foo.bar.com green
/etc/hostname
green
127.0.1.1 can be your eth0 ip
green in /etc/hostname must appear on the same line as what you want your fqdn to be in /etc/hosts, the fqdn must be the first column after the ip address. You can make green whatever you want, it's often foo. (if you change it in /etc/hostname you have to change it in /etc/hosts)
you can make foo.bar.com whatever you want, it could be bar.com. It should probably resolve to the eth0 ip address in the dns.
you can add other entries to the 127.0.1.1 line, put them between foo.bar.com and green.
You don't need to add an entry to /etc/hosts for virtual domains
That's the general gist of things. I'm sure there will be people who don't agree with what I've said.
@feldmand:
Must the hostname be listed once a FQDN, "servername.domain.tld" in the /etc/hosts file?
No. But it's a good idea.
@feldmand:Must one use linode.com as the "domain.tld" in the /etc/hosts file, for example, making the FQDN in the file "blinky.linode.com"?
No. You can either use the name linode gives you which will be something like li123-456.members.linode.com or you can buy a name from a domain registrar and either run our own DNS or get them to do it.
@feldmand:Can one use one of the registered domain names in the /etc/hosts file, for example, mydomain.com?
You can use any name you like in /etc/hosts but it won't mean anything outside your system if you own it and have DNS setup right.
@feldmand:If one plans to launch a multi-site virtual host configuration, can one arbitrarily choose one of the registered domain names for the /etc/hosts file, or must each registered domain name be accounted for in both the /etc/hosts file and the /etc/hostname file?
You only need one hostname in /etc/hostname. It's a good idea to put all names in /etc/hosts but you don't need to if they resolve to your IP by normal internet DNS.
@feldmand:Would the FQDN in the /etc/hosts file using a registered domain name look something like this: blinky.mydomain.com?
Yes, it should be IPFQDN shortnames
123.123.123.123 blinky.mydomain.com binky
@feldmand:
- Both user ops and the O'reilly book appear to indicate that the hostname should be assigned to 127.0.0.1. However, Linode's Stan recommended that the 127.0.0.1 line only reference localhost, removing my prior hostname reference. Must localhost appear prior to the hostname on this line?
The hostname can be assigned to any IP that is normally up. 127.0.0.1 should always be up so you can use that. Localhost must resolve to 127.0.0.1. The order of lines isn't important, the order of shortnames after the FQDN isn't important.