Problem with changing hostname

Motamedi

Well-Known Member
Mar 14, 2015
81
0
6
Iran , Tehran
cPanel Access Level
Root Administrator
hello

my problem is after change hostname cpanel , when entered domain.com/cpanel to web browser , redirect to old hostname

example : old hostname : server.domain1.com changed to server.domain2.com

when entered " userdomain.com/cpanel " to web browser , redirect to old hostname " server.domain1.com "

hostname changed to " change hostname cpanel " and /etc/hosts , but my problem not resolve

please help me for solve this problem

thanks ....
 

HostingH

Well-Known Member
Jan 13, 2008
125
17
68
cPanel Access Level
Root Administrator
Hello,

If you are using centos 7 then need to change/set new hostname in following files,
/etc/sysconfig/network add HOSTNAME=server.domain.com then /etc/hosts >> IP server.domain.com server then after run command, hostname server.domain.com and restart network service.

That's all
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,216
463
Hello,

Additionally, try clearing your browser and DNS cache on your computer after making the change to rule out the possibility that you are viewing cached data.

Thank you.