Explain this one!

Red Squirrel

No Lifer
May 24, 2003
70,579
13,805
126
www.anyf.ca
ok this is really weird. I have two hosts in my DNS that point to same IP, they are seperate A records.

I then have two virtual host entries for each of those sub domains in apache on my other server.

One of them responds to http, the other does not, yet it's the same IP! Most likely at apache end, but how is it that it does not even respond?

ex:



C:\Documents and Settings\ryan.BORG>nslookup img.redsquirrel.me.loc
Server: extsrv.loc
Address: 10.10.0.10

Name: img.redsquirrel.me.loc
Address: 10.1.1.10


C:\Documents and Settings\ryan.BORG>nslookup gal.redsquirrel.me.loc
Server: extsrv.loc
Address: 10.10.0.10

Name: gal.redsquirrel.me.loc
Address: 10.1.1.10


C:\Documents and Settings\ryan.BORG>telnet img.redsquirrel.me.loc 80
(screen goes black and I can send/recv data)

C:\Documents and Settings\ryan.BORG>telnet gal.redsquirrel.me.loc 80
Connecting To gal.redsquirrel.me.loc...Could not open connection to the host, on
port 80: Connect failed

C:\Documents and Settings\ryan.BORG>



How is this possible? How does a tcp application know the difference between two host names? Doesn't it work by IP only?
 

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
Originally posted by: RedSquirrel
Ended up working on it's own after a while. Would be quick to blame dns propagation, but odd the nslookup worked...

That's odd that it started working on it's own. I would have guessed it was using Named Virtual Hosts.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Ended up working on it's own after a while. Would be quick to blame dns propagation, but odd the nslookup worked...

There's no such thing as DNS propogation when you're working with internal names, unless you've got 2 DNS servers internally but since nslookup worked that wouldn't come into play either.
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
Originally posted by: Brazen
Originally posted by: RedSquirrel
Ended up working on it's own after a while. Would be quick to blame dns propagation, but odd the nslookup worked...

That's odd that it started working on it's own. I would have guessed it was using Named Virtual Hosts.

I was just about to post the same thing.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: MrChad
Originally posted by: Brazen
Originally posted by: RedSquirrel
Ended up working on it's own after a while. Would be quick to blame dns propagation, but odd the nslookup worked...

That's odd that it started working on it's own. I would have guessed it was using Named Virtual Hosts.

I was just about to post the same thing.

That only matters if you are making a true HTTP request and not just using telnet to open the socket on port 80. The hostname gets sent along with the HTTP headers, that's how the web server knows which virtual host to respond with.
 

Red Squirrel

No Lifer
May 24, 2003
70,579
13,805
126
www.anyf.ca
Originally posted by: Crusty
Originally posted by: MrChad
Originally posted by: Brazen
Originally posted by: RedSquirrel
Ended up working on it's own after a while. Would be quick to blame dns propagation, but odd the nslookup worked...

That's odd that it started working on it's own. I would have guessed it was using Named Virtual Hosts.

I was just about to post the same thing.

That only matters if you are making a true HTTP request and not just using telnet to open the socket on port 80. The hostname gets sent along with the HTTP headers, that's how the web server knows which virtual host to respond with.

Yep that's what made it weird. At first I thought I may of just screwed up my config or something as I was only testing with my browser.

There does seem to be some propagation involved even locally though. I think the OS actually caches records for some time, like 5-10 minutes maybe (or whatever TTL is, I don't know)
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
There does seem to be some propagation involved even locally though. I think the OS actually caches records for some time, like 5-10 minutes maybe (or whatever TTL is, I don't know)

Windows does have a local DNS cache by default, however nslookup won't show that since it always queries the DNS server and ignore the cache.