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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can DNS Point to a Port? 3

Status
Not open for further replies.

Zych

IS-IT--Management
Apr 3, 2003
313
US
I have an interesting challenge that I am not sure if DNS can handle or not. I have one static IP but I have two Web servers. I would like some domains to go to one server and other domains going to another. Is this possible?

Basically I have ColdFusion running on a NT IIS box and all other domains running on Apache PHP (right now also NT but I plan on moving it to Linux).

Thanks,

Zych
 
If you want to be able to access both webservers via the 1 static IP then you will need to change the port that 1 of your werbevers is running on to something different.

This really doesnt have anything todo with DNS. You will have to point all the domains to your static IP then forward the port to the correct webserver.



 
How do I forward it to the correct web server once it hits my firewall? In other words if all domains have the same IP how would the firewall know where to forward it to?

Thanks,

Zych
 
say webserver 1 is running on port 80 and webserver 2 is running on port 81

You would configure your firewall/router to forward port 80 to server 1 and port 81 to server 2.

When trying to access your server you would have to add the port 81 into the domain name for any pages running on server 2 ie
 
I guess I am still a little confused. Lets say I have domain1 hosted on server1 port 80 and domain2 on server2 port 81. Now a customer wants to see info on domain1 so he/she types This should work since domain1 is on port 80. Now if a customer types in how is my system going to know to send it to port 81?

The only way I can think of is having the server at port 80 redirect all pages for the other domain with the port number or if possible have the DNS do it for me.

- Zych
 
you will have to add the port number onto the end.

Thing is you only have 1 static IP so you can only forward port 80 once hence the reason to use another port for the other server.

You could however goto your ISP and request more static IP's.

Or just use one webserver.

 
You can say that again Faithless, here's a star for you.
 
Perhaps a little cheat here might work. As you are using IIS, you can set a fake virtual website with the same name as the one on your apache server. The users who type in the apache website address get directed here as per normal for port 80. In the default.htm page, use a redirector script to take the user to the apache server straight away. You would have to mask the address so it shows rather than but this should be easy enough.
Using this method, outside users should not have to type in a port number after the web address.

This is a theory btw but I can see no reason why it should not work.



Claudius (What certifications??)
 
I might be wrong but the way I understand it Zych is trying to do some kind of load balancing. As Faithless said, 1 option is to request more Static IP, this way you can implement DNS Round Robin wherein you can have mulitple webserver/ip with only one domain name(home pages).
 
Well I think the only real answer is that I am going to have to use a redirector like what ClaudeK suggested. I had a feeling DNS did not support this but it would be nice. The extra cost of having another IP is a little too much right now.

Thanks,

Zych
 
Why not run both sites on the same server? That would be the easiest solution.
 
Servtastic that is a good question but I do have an answer. I want to setup a Linux box running Apache, PHP, MySQL and a program called osCommerce. This would run my own website but I have a customer who wants me to host his site. I developed his site in Coldfusion and I only have the Coldfusion server software for Windows IIS. At some point I will end up changing it over to PHP but I do not have the time to do it right now. If I had the money right now I would upgrade the Coldfusion server software to the latest release for Linux/Apache, but I don't have the cash on hand. Therefore my delima to keep the older IIS system still up and available but with the capability to use my new Linux box as well.

- Zych
 
In IIS you have an option to specify host headers. This lets you answer your webserver to a request from e.g. to port 80 for instance, and on the 2nd website you configure the host header with and port 1080.

If a client looks up it will automatically be pointed to the correct website.

HTH,
Beboen
 
Thanks Beboen,
I didn't know IIS could do this. I know Apache supports this but it's good to know that IIS does too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top