Entry in /etc/hosts responds to ping but not in browser

2

0

A little background:

  • I'm running Mac OS X 10.6.4
  • I have a site set up on my external web server
  • The site on my server is set up with DNS records ready to respond to "mydomain.dev"
  • There is no public domain name set up for this site (yet)

I want to be able to access this remote site so I have made an entry in my /etc/hosts file with the public IP and mydomain.dev.

When I ping the domain it responds with the correct IP but when I browser to it through my browser (Chrome and Safari) it comes back with an "unable to determine IP address" error. This error is coming from Squid which we are using as a proxy at work.

Is there a way to access this site using a temporary domain name? I would have expected that the browser went to my local hosts first to get the IP rather than trying through DNS, or is the proxy just trying to be too smart and stuffing me up?

Carl

Posted 2010-10-11T03:21:55.163

Reputation: 121

Lil tip: for /etc/hosts www.mydomain.dev != mydomain.dev. So if you type in browser: www.mydomain.dev and you have /etc/fstab entry for: ip mydomain.dev it wont work – Kamil Klimek – 2010-10-14T11:15:56.453

Answers

2

In your web browser you may need to add your domain in the 'Ignored hosts' tab. For example, in Chrome hit 'Options' -> 'Under the Hood' -> 'Change Proxy Settings' there is an 'Ignored Hosts' tab.

You mentioned the domain is 'mydomain.dev', so try adding *.dev to this list.

JT.WK

Posted 2010-10-11T03:21:55.163

Reputation: 1 928

Thanks JT.WK. I gave that a shot but still ended up with the same error. The proxy they have in place at work is transparent so no settings are set on the actual desktop/laptop itself.

I tried connecting through a different network (not my corporate network) and it works fine, so probably just a problem at the proxy end. Maybe not much I can do about it?? – Carl – 2010-10-11T04:14:34.313

2If it's a transparent proxy (and it's not working now), there's not much you can do. The problem is almost certainly that the proxy can't resolve mydomain.dev, and unless you have admin control over the proxy to add that to its hosts file (or equivalent)... – Gordon Davisson – 2010-10-11T05:52:15.710

Hi Gordon. Thanks for that. I think it's the case. It's working perfectly from home so I'll just have to deal with it that way. – Carl – 2010-10-11T07:09:22.897