Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a 2003 Server VM named Gemini, it has 2 IP addresses 10.0.0.25 & 10.0.0.99. I have a website on that box that listens on 10.0.0.99:81. Is there anyway I can alias 10.0.0.99:81 to dev.gemini. So in a browser on the network, users can type dev.geminiand they would be pointed to 10.0.0.99:81. I'm not sure if I'm asking the right question. Is there a DNS or HOST thing I can do. Any links would be helpful.

Thanks, ~ck

share|improve this question

4 Answers 4

To handle port-remapping, you need a reverse proxy. Configuration will depend on which one you use, but it can look at the host header of the request and then forward to the correct server and port.

share|improve this answer

if you put 10.0.0.99 dev.gemini in your hosts file users will be able to access it by typing dev.gemini:81

share|improve this answer

This is something you do on the host, not with DNS.

DNS points a name to an IP. So you can point 10.0.0.99 to dev.gemini.

In order to have a web request normally bound to port 80 automatically go to port 81, you can do it as simple as a META HTTP redirect in the index.html of a web server listening on port 80 which redirects to port 81.

<html> 
<head> 
<title>redirect</title>
<META http-equiv="refresh" content="5;URL=http://dev.gemini:81/">
</head> 
</html>

Then any request to dev.gemini would redirect to dev.gemini:81. Users would see that in their URL/address bar but it would work. It wouldn't redirect dev.gemini/something to dev.gemini:81/something. You could do that with more sophisticated URL rewriting rules within the web server. IIS has ways to do this, I'm sure. I know it's far easier with Apache.

share|improve this answer
    
Ya, but I imagine if the person is using 80 it is because something is already using it ... if not, better to make it listen on 80? –  Kyle Brandt Aug 18 '09 at 17:51
1  
Ideally he should just use the virtual server feature of IIS so that requests to www.gemini and dev.gemini can live on the same IP and port but have different virtual websites. –  Kevin Kuphal Aug 18 '09 at 18:08

You can alias the IP to a hostname in the user's C:\WINDOWS\system32\drivers\etc\host file like:

10.0.0.99    dev.gemini

You can not however change the port with the hosts file. DNS has nothing to do with ports, it name to IP mapping only.

share|improve this answer

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.