I intend to purchase a domain, say for instance muppets.org, for my web server and I would like to install Postfix on the same machine for sending transactional emails.
Am I expected to set as hostname for my system muppets.org, or I can use as hostname kermit, so that my FQDN can be kermit.muppets.org?
According to Digital Ocean's documentation on Postfix, my server's hostname should match my domain, muppets.org: is that necessary or instead I can use as hostname kermit and edit /etc/hosts as follows?       localhost.localdomain           localhost       kermit.muppets.org              kermit    kermit.muppets.org              kermit
  • 1
    This is a networking question that has nothing to do with Ubuntu (or any OS). Your DNS provider cares deeply about your FQDN (that's their job), but cares nothing about the system hostname. They will direct all DNS lookup requests to a specific IP address, regardless of the hostname at that IP address. – user535733 Dec 29 '18 at 13:42

Regardless of the name that you assign to your computer (hostname), what will define whether or not it is in a subdomain will be the public DNS server (bind, for example) and not the /etc/hosts file, which only affects the requests of your local network. You can manage the subdomains on your Resource Records A, AAAA, CNAME, MX, TXT, PTR, SRV.

Note that one of the prerequisites of that article is "A valid domain name, like example.com, pointing to your server."

You can use kermit.muppets.org since you point the DNS server to that VPS server. Another approach is to set a reverse proxy to point to the resource you want.

Check out a more detailed explanation here: https://serverfault.com/questions/507103/hostname-or-subdomain

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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