Should 127.0.0.1 and ::1 both be included in /etc/hosts file

hosts-file

I am new to unmanaged VPS servers and in addition IPv6. Is it necessary to include 127.0.0.1 AND ::1 for localhost in /etc/hosts files for IPv6 enabled servers, or is ::1 alone enough?

Best Answer

Yes, 127.0.0.1 should be left. IPv6 is enabled, but IPv4 is still used.