w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
FQDN hostname for both www and mail

You do not need to list the multiple host names in /etc/hostname. You only need to configure DNS to point the individual hostnames to your IP address. You will need to check the documentation for your mail and http servers to configure the individual hostnames there as well.

For http (assuming you are using apache httpd as your web server), you could configure your hostname like this: (adapted from the configuration here)

NameVirtualHost *:80

<VirtualHost *:80>
    ServerName www.mydomain.com
    ServerAlias domain.tld
    DocumentRoot /www/domain
</VirtualHost>

<VirtualHost *:80>
    ServerName www.otherdomain.com
    DocumentRoot /www/otherdomain
</VirtualHost>

Or better yet, leave off the NameVirtualHost line and replace the * with your IP address.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.