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?

1

5 Answers 5

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
  • 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, 2014 at 18:20
4

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

2
  • 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, 2014 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, 2014 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
1
  • 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, 2014 at 18:21
2

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

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

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.

1
  • I don't even get that bar. It's a fully-qualified domain name too.
    – psion
    Aug 17, 2012 at 3:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .