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 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.)

share|improve this question

migrated from stackoverflow.com Mar 24 '11 at 22:47

This question came from our site for professional and enthusiast programmers.

    
Check your /etc/nsswitch.conf and /etc/resolv.conf. Both control how DNS resolution works on the local machine. –  Marc B Mar 24 '11 at 22:25
2  
You use IE/Chrome on the Solaris? –  M'vy Mar 24 '11 at 22:27
    
No. A Solaris machine hosts the site. I must use IE or Chrome (or FF) on a Win-XP computer to access the site because of VPN and company IT restrictions. –  lsiden Mar 25 '11 at 1:01
    
On Windows, there is no nsswitch.conf or resolv.conf. Is there some equivalent that controls whether or not DNS will look first in .../etc/hosts? –  lsiden Mar 25 '11 at 1:05
    
I found this post that suggested that I restart the DNS cache on Windows. Tried it. Can ping it with my URI, but still can't reach it from the browser. Rats!@ –  lsiden Mar 25 '11 at 1:25

2 Answers 2

up vote 1 down vote accepted

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

share|improve this answer
    
First, I had to reboot Windows ;). Then I tried your telnet suggestion. I didn't get back a page but I got this in the access log: "10.195.51.65 - - [25/Mar/2011:12:25:42 -0400] "GET GET\b\b\b\b\b\b\b\b\bGET / HTTP/1.0" 400 226". The backspaces are a consequence of my term (Putty) not echoing anything to me in telnet so I can't see WTF I'm doing! But something is definitely working now! Thanks! –  lsiden Mar 25 '11 at 15:30

(Expanding on M'vy's comment)

It is the client which performs the name resolution.

On windows this can be done through the hosts file (link includes all resolution methods).

Happy ... networking.

share|improve this answer
    
I already said I put entries in /etc/hosts. That's what this question is about. –  lsiden Mar 25 '11 at 1:03
    
@Isiden you mentioned /etc/hosts, which makes it sound like a UNIX machine you were editing on, and later mentioned it was the Windows equivalent. That's what @pst was responding to. –  Rich Homolka Mar 25 '11 at 3:17

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.