0

I switched from Ubuntu to Debian

And in debian the /etc/hosts file after a new install is (on a cloud server):

127.0.1.1   static.246.62.63.178.clients.your-server.de static

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

What is static.246.62.63.178.clients.your-server.de ?

Seems like the ip address is reserved for future use.

Do I leave it in place of replace it? E.g. is this okay (if my server is example.com):

127.0.0.1   localhost example.com

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback example.com
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
4
  • The installer might have got that hostname from DHCP, and I don't think it's unusual for installers to write a configured hostname to /etc/hosts.
    – muru
    Commented Apr 20, 2022 at 18:44
  • @roaima, that is quite quirky and interesting. I still don't know where the IP address 178.63.62.246 comes from though. Commented Apr 20, 2022 at 18:55
  • 1
    For me this is the hostname of your VM, provided by your hosting provider. And probably 178.63.62.246 si the public address of your host. Commented Apr 20, 2022 at 19:08
  • Odd... on my Debian derivative (RPi OS), using the hostname for 127.0.1.1 is advised for use with Zero-conf networking (on a LAN).
    – Seamus
    Commented Apr 20, 2022 at 22:25

2 Answers 2

3

The IP address-as-a-name would usually be read in reverse (much like a DNS PTR entry), so the name should correspond to 178.63.62.246 rather than 246.62.63.178.

In this instance that would suggest a server from Hetzner.

You can remove the entry, but if that's what the machine is called - what it's known as - it would be prudent to have an entry of some sort. For example

127.0.0.1      localhost loopback
178.63.62.246  my.preferred.hostname.example.com
178.63.62.246  static.246.62.63.178.clients.your-server.de
0

I think @roaima's answer is correct, but Debian has some more information on this if you're interested. Specifically wrt the use of 127.0.1.1:

For a system with a permanent IP address, that permanent IP address should be used here instead of 127.0.1.1.

It's interesting that Debian (apparently) wrote this entry in your /etc/hosts file, and more so that the string has the word static in it.

3
  • 1
    static is a hostname, and as far I know, it is Hetzner that modify such file (and other) on their images. Commented Apr 21, 2022 at 7:47
  • So, on a cloud server means that the hosting service Hetzner has root privileges? I didn't understand it that way, but you're probably correct. Still seems an odd setup to me, but I've not had a hosted server for ages.
    – Seamus
    Commented Apr 21, 2022 at 8:20
  • I had several root server (metal, not virtual) on Hetzner. You can get also just virtual servers (with root). I think they do also "usual hosting" (but there is much more rivals on that market). Being able to select distros from a list, or being able to install and configure apache or other webservers and other packages, or deploy any container, and having own IP, etc. it is often an advantage (but it costs more then usual webhosting). Commented Apr 21, 2022 at 8:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .