Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DNS configuration for internal website lookup

Status
Not open for further replies.

nickkirby

Technical User
Mar 21, 2006
3
GB
Hullo!

Sorry if this has already been posted, but I am not sure if it details my exact situation.

I am intending to host people’s websites.

I have a static IP address on my router. As I understand it, is it possible to point where my domain names are hosted – (for example) to this domain directly, or should I use something like dyndns, setting the IP to static?

Anyway, having pointed traffic to me, they pass through to my webservers. Now, here I come unstuck. I currently have four webservers boxes, on 192.168.5-9, hosting multiple different websites on each. One server, for example is high traffic, so sits alone.

I understand that DNS can point traffic to the IP address of the server, how then does it manage to direct people to the website?

Eg if server IP 192.168.1.5 hosts example1.com and example2.com, how do I tell the (browser looking) where example1.com is?

Could the internal DNS simply say yes, I know you’re looking for that’s on 192.168.1.5, over there? What’s to stop the system retuning
 
What webserver are you running? On a Microsoft IIS server, you configure host-headers on each site, and different sites can use the same IP. The web server looks at the URL that the connection was coming in on (not the IP) and matches the URL to the appropriate web-site. So if the traffic is bound for then the shazampants.com site that has the host-header configured will take control of that connection. Same for the other site, stiltmonkeys.org, if you have host-headers configured there. You run into problems if you want to use SSL, since every site with SSL needs to have a distinct IP address.

Since all the traffic is going to the same IP on the outside, it doesn't really matter if you have the sites assigned different IP's on the inside, since it's typically inside where the host-headers work, unless you have some sort of advanced route-by-header technology running on your router, which I doubt.

As far as external DNS config, all your websites, and would resolve to the same IP address. It would be the web-servers job to sort out the difference between traffic bound for one site or the other, using host-headers.

ShackDaddy
 
Shackdaddy's right about SSL, a real concern for some.

In Apache parlance, multiple hosting is called Name Based
Virtual hosting. It inspects the host part of the called URL, section.

gene
 
So basically, if I had two separate servers, one running IIS, the other Apache, I wouldn't need to do anything except forward port 80 to both?

I'm being a thickie here, but I assumed there would need to be a DNS server where URLs were forwarded depending upon the site.

e.g.

is on 192.168.1.5
is on 192.168.1.5

is on 192.168.1.6

is on 192.168.1.7

Therefore the DNS server is a sort of "post office" which knows where to send "traffic" to for that particular site.

I am really grateful for your help. I am probably not explaining this very wel because I don't understand it as well as you fellows.

Nick
 
No, if you are not going to use SSL, then you only need 1 ip. Either Apache or IIs can do the same thing...listen to a port 80 or a particular IP.

So all those sites you specify can be hidden behind one external IP that maps to one internal one.

Suppose a.b.c.d is the external IP, e.f.g.h is the internal.

All those web servers would be ip a.b.c.d

You would map a.b.c.d port 80 to e.f.g.h port 80.

The web server (you choose, apache or IIs) would
listen to e.f.g.h port 80.

The webserver by virtual hosting will do the "right" thing, if the URL says
It will take the host part and try to match it to one of it's virtual servers. In Apache, this is a match to ServerName (I don't know what the term is in IIs)

gene
 
Ah ha. I get that bit. How does the system work if I have three different computers?

Assuming there are three separate physical servers.

If I direct traffic to port 80 on 192.168.1.5, the sites there will resolve, but what about the other two servers on 1.6 and 1.7?

How are they "found"?
 
If you have only one Internet IP, then you need to allocate one of your server to run a reverse proxy. This means all the port 80 traffic will come to one server and it will traffic cop to itself or other servers.

Now a caveat. I don't run this configuration, but someone will chime in here, but here is a link:


You would use Virtual Hosting with ProxyPassReverse to forward/rewrite that traffic correctly. This is apache centric, but I am sure IIs has the same facility.

gene
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top