0

I would like to set the hostname of my Ubuntu 16.04 to a FQDN, as I plan to install Postfix server. However I have multiple domains hosted in the web server via Apache2 virtual hosts. For example:

  1. example.com
  2. domain.com

My question is, how should I set the hostname? Use either one of the domains? or I can use an unrelated/non-existent name for the hostname?

Raptor
  • 991
  • 3
  • 16
  • 36

1 Answers1

2

Hostnames for most part are internal settings - your DNS settings will enable traffic to reach your server if the FQDN is set, and the point of virtualhosts is to serve different sites based on what hostname it is. In the case of email, its just one server, and your mail server config (the flurdy guide is pretty useful - and stores these in a database) should handle it.

You don't generally need to set it there, and the hostname of a system can be independent of its domain name, and your mailserver can respond to one or more domains, the same way apache can do virtualhosts.

You set up the appropriate nameserver records for the domains you want to serve (mx and/or a/aaaa names) and set the mail server to listen for and serve those domains. As such, you don't 'need' to set the hostname to anything specific, and its better leaving it as a identifier for whoever's logged in.

Journeyman Geek
  • 6,969
  • 3
  • 31
  • 49