Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Host name is not persistent in CentOS 7

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
1 post • Page 1 of 1
realjumy
Posts: 50
Joined: Sun Jul 06, 2014 12:51 pm

Host name is not persistent in CentOS 7
  • Quote

Post by realjumy » Sun Jan 13, 2019 11:32 am

Hi guys.

I tried everything to sort this. I have chosen a proper host name during the installation, I have tried changing the hosts file, using VestaCP panel... But the host name for my installation continues changing to that one defined by my VPS providers (OVH). Is any of you having the same issue or knows how to change it and make it persistent?

Thanks!

Edit:

After communicating with OVH, the answered me the following:
1. Edit /etc/sysconfig/network:

Code: Select all

HOSTNAME=hostname.domain.com
2. Update /etc/hosts:

Code: Select all

149.202.50.229 hostname.domain.com hostname
3. Run the hostname command to get OS to remember:

Code: Select all

hostnamectl set-hostname hostname.domain.com
4. Check if it knows the hostname:

Code: Select all

[root@vps ~]# hostname
hostname.domain.com

5. Restart the interface:

Code: Select all

/etc/init.d/network restart
If you reboot the OS it should stick with the set hostname.

I can confirm that it works.

Code: Select all

/etc/sysconfig/network
contained a message asking not to modify its content, and until now, I was respecting it (and maybe that's the reason why it was not working).
Top


Post Reply
  • Print view
1 post • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password