Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

5 Answers 5

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.

share|improve this answer
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 at 18:20

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

share|improve this answer
    
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 at 18:22

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
share|improve this answer
    
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 at 18:21

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

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

share|improve this answer

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.

share|improve this answer
    
I don't even get that bar. It's a fully-qualified domain name too. –  psion Aug 17 '12 at 3:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.