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

0 Members and 1 Guest are viewing this topic.

Offline
*
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 myserver.domain.com and server IP address 199.199.199.199 , 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
server1.domain.com
neptun.domain.com
srv1.domain.com



How to Change Server Hostname on CentOS Server



1.

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

Example:
Code: [Select]
nano /etc/sysconfig/network
Code: [Select]
HOSTNAME=myserver.domain.com

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

BEFORE
# cat /etc/hosts
127.0.0.1  localhost.localdomain localhost

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

3.
From command line
Code: [Select]
hostname
hostname myserver.domain.com
AntiDDoS Protection (web + mail)
http://centos-webpanel.com/website-ddos-protection-proxy

Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp


Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Do you need Fast and FREE Support included for your CWP linux server?
http://centos-webpanel.com/noc-partner-list
Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services

Offline
*
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/main.cf
  • /etc/postfix/master.cf
  • /etc/dovecot/dovecot.conf
  • /etc/postfix/sender_whitelist
  • etc/postfix/sender_blacklist
or all your custom settings will get lost!

All the best,
Ben