Entry in /etc/hosts file always redirects to localhost (mac)

@partisan

Could you clarify if the localhost.example.com is the Local site? When you hit that URL where does it goto?

One suggestion is to ensure that IPV6 Loopback is set in Local. You can do that here:

  1. System Preferences
  2. Advanced
  3. Ensure that IPv6 Loopback is enabled / on.
  4. Click Apply.