Re Update hosts file and FQDN
Need to understand the step at "Update etc/hosts"
Distribution: Ubuntu 10.04 LTS
My Linode will host 3 websites. The registered domains will point to Linode's DNS
Q 1: Must there be an entry in the hosts file for each of the domains, for example:
127.0.0.1 localhost.localdomain localhost
xx.xx.xx.xx myhostname.domain1.com myhostname
xx.xx.xx.xx myhostname.domain2.com myhostname
xx.xx.xx.xx myhostname.domain3.com myhostname
Q2: Or do I only have to enter a single FQDN in the hosts file? If so, am I correct to assume the domain must be registered and pointing to Linode DNS? Would one of the 3 domains be able to serve this purpose?
Thanks
3 Replies
You don't need to be using Linode's DNS hosting service. All that matters is that the proper A record exists, at whatever DNS host you use.
You already have a valid FQDN. It's "li-XX.YYY.members.linode.com". There's no reason to change it unless you want to customize your shell prompt or you need to keep track of multiple servers. Neither of these are urgent concerns if you're just starting with Linode.
In fact, for newbies, it's probably best to leave your hostname alone, because any error in this area will cause problems when you try to add Apache virtual hosts or send password reminder e-mails from your website. Too many people misconfigure hostnames and cause their e-mails to get sucked into a black hole. Trust me, you don't want to have that headache. Having your IP address hard-coded in the hosts file will also cause issues if you ever need to move datacenters.
Adding something to the hosts file won't magically make it a valid FQDN for hosting and e-mail purposes. All it does it to trick programs like Apache to think that they have an FQDN when in fact they don't, because the hosts file overrides the public DNS system. This is sometimes useful, but newbies find it too easy to abuse the hosts file to hide DNS problems instead of actually fixing them. So again, my advice is "Don't touch the hosts file."
As long as you use Linode's default hostname as your FQDN, you'll be fine. What you use as your FQDN has absolutely no effect on what domains you'll be able to host or what domains you'll be able to send e-mails from. It's a purely cosmetic choice. If you want to change the default, you should make up a proper subdomain in your DNS manager. You don't even need to add it to the hosts file if it has been properly set up in your DNS manager.