1

Here is my /etc/hosts on a fresh CentOS:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

I guess the -4 and -6 variations are IPv4 and IPv6 writ explicit, but why does CentOS feel like I need localhost.localdomain and localhostN.localdomain? Are they standard usage for something? Can I get rid of these without breaking anything?

1

It would be a Really Bad Idea to remove the localhost entries; many tools, utilities, and scripts use that by name expecting it to resolve to the loopback address. Less so for the .localdomain and even further less so for the *4 and *6 entries, but it's entirely possible that those may come into more prolific use as IPv6 proponents start to get more traction. It's also possible some tools could start coming into circulation that use the *4 and *6 entries to limit traffic to the relevant versions of the IP stack.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.