6

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?

slhck
  • 228,104
psion
  • 211

5 Answers5

4

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.

  • 1
    This is a less-optimal way of solving it. Without http:// in front of the domain, Chrome may assume that you've made a "navigation error" / lazy search. With http:// it shouldn't argue. – BowlesCR Jan 29 '14 at 18:20
4

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

slhck
  • 228,104
  • This should do it. By declaring the http:// protocol up front Chrome should assume you know what you're doing and just try the address as given instead of trying to be helpful. – BowlesCR Jan 29 '14 at 18:22
  • Doesn't worked for me. The Chome just writes «Couldn't retrieve URL», although plain ping there works like a charm. – Hi-Angel Sep 30 '14 at 12:26
4

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
konus
  • 143
  • 1
    This really shouldn't affect the situation unless you're trying to override the domain name of a real site that happens to be IPv6 enabled and point it back to your local machine. – BowlesCR Jan 29 '14 at 18:21
2

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

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

Phil
  • 21
0

In /etc/hosts list them like this:

192.168.0.4 foo.localdomain

Now when you type foo.domain in the address bar it will still return search results but you should see a bar asking you if you meant to go to foo.localdomain instead.

Strangely once I had got Chrome to do this once it started doing it for single host names in /etc/hosts but I had to use the host.domain form first.

slhck
  • 228,104
tallus
  • 111