OVH Community

Welcome to your community space. Ask questions, search for information, post content, and interact with other OVH Community members.

Hostname is not changed after rebooting


#1

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?