Chrome does not follow hosts file

I have custom domains set up for internal web site testing in my /etc/hosts file.

I try to access them in Chrome, and I get routed to a Google search instead. But when I ping the domains, they show that they are working.

What should I do to make sure I can access these sites in Chrome?


Solution 1:

Disable "Use a web service to help resolve navigation errors" in Chrome's Settings under Privacy. Try flushing Chrome's cache after disabling this and see if it works then.

Solution 2:

You can just throw an http:// in front of your local address; that worked for me.

Solution 3:

As the answer in stackoverflow, the solution for me was adding ::1 in /etc/hosts like:

127.0.0.1 foo.domain.local
::1 foo.domain.local

Solution 4:

just use the domains like so http://localstite.dev/ .

It's the "/" at the end to resolve the host...