0

Background: CentOS 8, Digital Ocean droplet.

Question 1) I just looked at my hosts file in /etc/hosts and I noticed that hostnames listed under IPv4 and IPv6 are different. IPv4 lists example, example.com and mail.example.com while IPv6 only lists example example. Is this correct? Intuitively it makes sense to me that they should be the same for both IPv4 and IPv6.

# The following lines are desirable for IPv4 capable hosts
127.0.0.1 example example.com mail.example.com
127.0.0.1 localhost.localdomain localhost
127.0.0.1 localhost4.localdomain4 localhost4

# The following lines are desirable for IPv6 capable hosts
::1 example example
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
Mircea Vutcovici
  • 17,619
  • 4
  • 56
  • 83
myNewAccount
  • 569
  • 1
  • 6
  • 19
  • 1
    I would suggest that you check if this file matches what Centos 8 creates. If so, ask Centos and/or Redhat. If not, ask Digital Ocean. I don't think anyone else will be able to answer why they did it that way, it looks more like a mistake. – Håkan Lindqvist Apr 29 '20 at 12:51

1 Answers1

1

Looks like a typo.

One could argue they should be the same, and at the same time it really does not matter because it is only an example value.

While multiple shell scripts etc. could rely on the correct setting of localhost, I hope nobody and no tool assumes anything about http://example.com/. (Just in case you are wondering: it is a reserved domain as per RFC6761 and IANA put a placeholder page there.)

mschuett
  • 3,146
  • 21
  • 21