Setting up an FQDN
I'm trying to set up an FQDN as per the Getting Started documentation but I'm a bit confused as to the format of it.
I'm planning to run a basic site without subdomains and am not sure how to go about the FQDN setup.
Since I'm not using subdomains, would it simply be www.example.com or something else?
5 Replies
Yes! You can use either 'www.example.com' or just 'example.com' and either should work for you. Generally, I've seen more cases of using 'example.com' and setting up 'www.example.com' as an alias than using 'www.example.com' as the domain by itself.
Thank you.
So would I ignore the local hostname mentioned in the Getting Started guide here: https://www.linode.com/docs/getting-started/#update-your-system-s-hosts-file
I'm also not sure which address to map to the FQDNm The Getting Started page says to use a public address but the page on hosts files has a private address being mapped to it. And would we use localhost.localdomain or just localhost as per the default hosts file and the examples in the page on hosts files?
The doc seems to suggest the following might be typical of a basic host file setup.
127.0.0.1 localhost
127.0.1.1 PersonalComputerName.example.com PersonalComputerName
173.230.136.191 PersonalComputerName.example.com PersonalComputerName
or
127.0.0.1 localhost
127.0.1.1 PersonalComputerName.www.example.com PersonalComputerName
173.230.136.191 PersonalComputerName.www.example.com PersonalComputerName
Is that right? Thanks.
Could I get clarification as to the above questions please?
This is a common point of confusion (took me a long time to get a solid handle on FQDN and hostname mapping). In general, on your Linode, you'll want your /etc/hosts file to look like this (replacing 203.0.113.10 with your Linode's public IPv4 address and example.com with your desired FQDN):
127.0.0.1 localhost
203.0.113.10 example.com www.example.com hostname
I've found this post helpful on understanding /etc/hosts too. Mapping your hostname to 127.0.1.1 isn't necessary if you're mapping to a public IPv4 address.
On the DNS end, you'll want your base domain and an A record for 'www' (or a wildcard record) pointing to the public IPv4 address.