1

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

Hcabnettek
  • 111
  • 1
  • 3

4 Answers4

2

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.

Matt Everson
  • 268
  • 1
  • 7
1

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

Jure1873
  • 3,692
  • 1
  • 21
  • 28
1

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.

Kevin Kuphal
  • 9,064
  • 1
  • 34
  • 41
  • 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
1

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.

Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444