SQUISH LOGO  
 


  << Previous Topic | Next Topic >>Return to Index  

Name resolusion

June 13 2008 at 4:00 PM
  (Login dim46)

 
My company uses one IP address to host two web sites, let say www.domain_1.com and www.domain_2.com.
I've been analyzing two web sites and found a strange thing.

Let say, there are two home pages:

1. http://www.domain_1.com/folder_1/folder_2/home_1.htm
2. http://www.domain_2.com/folder_3/folder_4./home_2.htm

The strange thing is when I replace domain portion of URL like:

http://www.domain_2.com/folder_1/folder_2 - replaced "domain_1" with "domain_2" I get the same page as I used "domain_1".

I am not a DNS guru. Any help in explanation of how it happens greatly appreciated.

Thanks

 
 Respond to this message   
AuthorReply
James
(Login squish)
Forum Owner

Re: Name resolusion

June 16 2008, 12:33 AM 

As you say, your web browser will resolve both of those addresses to the same IP address.

There will be something in your company that is listening to that IP address and serving requests. It might be a web server directly or a load balancer or something similar.

Whatever it is, it needs to accept the http connection and then read the Host: header which is sent by the web browser to decide what to do. The Host: header is simply the text between http:// and the next slash, e.g. www.domain_1.com or www.domain_2.com.

In the simplest scenario where the IP address resolves directly to a server which runs web server software, the web server software will have configuration, typically called Name Based Virtual Hosting which permits you to have separate configuration for each web site based on it reading the Host: header passed by your web browser.

It sounds as if you don't have Name Based Virtual Hosting, and are using just IP-based virtual hosting, and the web server software isn't distinguishing between the two site based on the Host: header. At least, not in general.

If you can type http://www.domain_1.com/ and http://www.domain_2.com/ and get different pages, then it's possible someone has setup some kind of Host: header check on the front page, either using the web server software configuration or in the actual web page code itself. If you immediately get a redirect to /folder_1/ or /folder_2/ respectively then that would increase the chances that this is how it is configured.

James


    
This message has been edited by squish on Jun 16, 2008 12:33 AM


 
 Respond to this message   

(Login dim46)

Re: Name resolusion

June 16 2008, 2:16 PM 

Hi James,

Thanks for your response.

If I type http://domain_1 I get redirect to the folder_1/folder_2 to the home page. If I replace domain_1 with domain_2 and do not change folder 's path I get the same page.

If I type http://domain_1 and domain_2 I get two distinct pages which are relative to the corresponding domains.

Ip address is the same for two domains.

I am not in charge for maintaining web server but the part of my job is to make suggestions for everything to work fine. Unless I do not understand what is happening is to hard for me to forward the issue to the right person.


Dmytry

 
 Respond to this message   
Current Topic - Name resolusion
  << Previous Topic | Next Topic >>Return to Index  
 Copyright © 1999-2009 Network54. All rights reserved.   Terms of Use   Privacy Statement  
james at squish dot net