Having issues changing hostname (Deb 9)

Hi there everyone!

I’ve got a dedi server leased from Kimsufi and I’m trying to change the hostname but am running into some issues.

Following the Debian wiki for changing hostname, I first edited /etc/hosts:       localhost       server.mydomain.com       server

# The following lines are desirable for IPv6 capable hosts
::1     localhost       ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters  server.mydomain.com       server

And /etc/hostname:


Then ran:

and rebooted:
On restart I shelled in:

[2018-06-21 11:10.39] ~
[micro.SCHWIM-DESKTOP] ➤ ssh root@mydomain.com
root@mydomain.com’s password:
X11 forwarding request failed on channel 0

Debian GNU/Linux 9 (stretch)

Linux ns349189.ip-111.eu 111.111.111-xxxx-std-ipv6-64 #222672 SMP Mon Jun 4 15:16:03 UTC 2018 x86_64 GNU/Linux

Server : 212410
IPv4 :
IPv6 : 1111:41d0:1:b5cf::1
Hostname : oldhostname-111.eu

    installed ISPConfig-Version: 3.1.12
    current   ISPConfig-Version: 3.1.12

Last login: Thu Jun 21 15:08:12 2018 from
root@server:~# hostname -f

hostname -f now shows properly but if I try to visit server.mydomain.com:8080 (or standard 80 for that matter), I get an unknown IP error:

In spite of that error, have I altered the hostname correctly? It seems I’m still lacking a step, according to the returned data at the top of the shell window. On login, it shows the old hostname as I pasted above.

What am I doing wrong?

You need to register the domain with a domain name service and setup the DNS to use that IP. Setting a hostname on a server makes it available on that server only, not globally.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.