Author Topic: Change Hostname (FQHN - FQDN)  (Read 32432 times)

0 Members and 1 Guest are viewing this topic.

Change Hostname (FQHN - FQDN)
« on: November 22, 2014, 12:33:35 AM »
Its Required to have a valid Fully Qualified Domain Name or FQDN for the hostname to be used on the inernet.

In this example we will use and server IP address , but you will need to replace it with your registered and working domain and your public server IP address!

Few Examples of server hostname (domain needs to be replaced with your domain name):e

How to Change Server Hostname on CentOS Server


Open the /etc/sysconfig/network file with your favorite text editor.
Modify the HOSTNAME= value to match your FQDN host name.

Code: [Select]
nano /etc/sysconfig/network
Code: [Select]

Change the host that is associated to your main IPaddress for your server, this is for internal networking (found at /etc/hosts file)

# cat /etc/hosts  localhost.localdomain localhost

AFTER (add main server ip and hostname)
# cat /etc/hosts  localhost.localdomain localhost myserver

From command line
Code: [Select]
AntiDDoS Protection (web + mail)

Join our Development Team and get paid !

Services Monitoring & RBL Monitoring

Do you need Fast and FREE Support included for your CWP linux server?
Installation Instructions
Get Fast Support Here

Re: Change Hostname (FQHN - FQDN)
« Reply #1 on: January 11, 2017, 11:13:51 PM »
If you change the hostname, you also have to edit the following files manually!
  • "$mydomain" @ /etc/amavisd/amavisd.conf
  • "ServerName" @ /usr/local/apache/conf/httpd.conf
they will not be changed automatically!

And maybe also:
  • "root:" @ /etc/aliases
if you have a custom root@ email-address set up.

Before rebuilding the mailserver I strongly recommend to backup you postfix and dovecot settings!
  • /etc/postfix/
  • /etc/postfix/
  • /etc/dovecot/dovecot.conf
  • /etc/postfix/sender_whitelist
  • etc/postfix/sender_blacklist
or all your custom settings will get lost!

All the best,