Hi,
I'm trying to change the hostname permanently in my VPS Essential following these instructions:
1) I edited `/etc/cloud/cloud.cfg` and added:
preserve_hostname: true
manage_etc_hosts: false
2) I edited `/etc/hostname` with "mydomain"
3) I edited `/etc/hosts` and have the following:
127.0.0.1 localhost
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
127.0.1.1 mydomain.com mydomain
Then when I reboot the VPS I check again the `/etc/hosts` file and had the following:
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
127.0.1.1 mydomain.com mydomain
127.0.1.1 vps-XXXXXXXX.vps.ovh.net.novalocal vps-XXXXXXXX
Why is always appending the `127.0.1.1 vps-XXXXXXXX.vps.ovh.net.novalocal vps-XXXXXXXX` line in every reboot if I changed the `/etc/cloud/cloud.cfg` correctly?
Hostname is not changed after rebooting
Related questions
- Installing Operating System from custom image on OVH VPS ( CentOS 8 Tutorial)
59026
11.01.2020 21:11
- SMTP server on VPS and port 25 opening
50073
10.12.2025 13:59
- Mumbai VPS data-center availability
47048
23.12.2025 04:48
- Nameserver for my vps
46669
07.08.2018 11:35
- Remote access to MySQL database
45718
16.01.2018 15:29
- VPS stuck in “Saving…” for over 24 hours – No SSH, No KVM, No Rescue
45563
10.01.2026 22:36
- Advice on products to run a simple website + CMS.
41854
07.01.2026 14:58
- VPS login and password not accepted. Reboot in Rescue Mode results in root and temp password not being accepted
40782
15.01.2026 20:04
- Change server location
38198
06.11.2020 10:16
- Redirect domain to vps
37706
03.01.2018 22:32