0

I run Centos 7 i was changing /etc/hostname "centos-512mb-blr1-01" to "srv1.domain.com" and rebooted for the changes to take place, since then all my websites are off.. i tried reversing the change.. but still getting ERR_CONNECTION_TIMED_OUT

Here is my configuration files:

[root@srv1 ~]# cat /etc/hosts
# The following lines are desirable for IPv4 capable hosts
127.0.0.1 srv1.example.com domain.com
127.0.0.1 example.com
127.0.0.1 localhost.localdomain localhost
127.0.0.1 localhost4.localdomain4 localhost4
139.59.57.xx srv1.example.com example.com

# The following lines are desirable for IPv6 capable hosts
::1 srv1.example.com srv1.example.com
127.0.0.1 example.com
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
139.59.57.xx example.com example.com


[root@srv1 ~]# cat /etc/hostname
srv1.example.com


[root@srv1 ~]# cat /etc/sysconfig/network
NETWORKING=yes
NOZEROCONF=yes
HOSTNAME=srv1.example.com

Kindly advise what i am doing wrong.

perlware
  • 33
  • 1
  • 5

1 Answers1

0

Have you also changed the configuration of your httpd/nginx/(whatever else)? Because if and you use the old hostname in webserver settings, it's likely it can't bind to the address.

Also in your /etc/hosts you have the svr1.example.com listed twice:

127.0.0.1 srv1.example.com domain.com
139.59.57.xx srv1.example.com example.com

Similar for the IPv6. It can be problem too. You should have one IP listed just once. Please try to modify your /etc/hosts to:

# The following lines are desirable for IPv4 capable hosts
127.0.0.1 localhost.localdomain localhost4.localdomain4 localhost localhost4 domain.com
139.59.57.xx srv1.example.com example.com

# The following lines are desirable for IPv6 capable hosts
::1 localhost.localdomain localhost6.localdomain6 localhost localhost6
139.59.57.xx srv1.example.com example.com
Jaroslav Kucera
  • 1,545
  • 11
  • 18