Dns – Why can’t the browser resolve a hostname through /etc/hosts

binddns

I set up a Apache2 on a new Solaris machine on my company's internal (firewalled) network and configured it for name-based virtual hosts.

We don't yet have a domain for the new machine, so I created my own, "lsiden.net", and named the host something like "myhost.lsiden.net" in the httpd.conf <VirtualHost> directive.

Since no such domain is registered, I created the entry "w.x.y.z myhost.lsiden.net" in my /etc/hosts file. (I will delete it when we get a real domain name.)

I can ping myhost.lsiden.net but if I type it in either IE7 or Google Chrome 10, it won't resolve. Is there something that is preventing each browser from looking in the /etc/hosts file?

(In order to access my company's VPN, I have to use the machine that they configured for me which was provisioned with Windows XP. So /etc/hosts is actually something like c:\Windows\system32\drivers\etc\hosts, but that shouldn't matter.)

Best Answer

As far as 'why does one work and not the other' one thing to remember is that ping uses a different protocol (icmp) than http (tcp). Can you check firewalls on your Windows host? A lot of VPNs are configured to firewall certain things.

The next step after ping is the old webmaster (I'm dating myself by using that term) tool: telnet.

Can you try:

telnet <machine> <port>

from your Windows box.

If this doesn't connect, you have connection issues. Possibly a firewall, or something else.

If it does connect, try typing:

GET / HTTP/1.0
Host: <nameOfVirtualHost>

ReturnReturn

Which then should show you your page.

I'd flush the system DNS cache if you haven't yet:

ipconfig /flushdns

Browsers themselves may use a DNS cache. I know Chrome does, couldn't find a way to flush it. There's a Firefox plugin that flushes DNS cache

Related Question