DNS or Hosts help. Can I alias this IP address & port to something more friendly?

5,118

Solution 1

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.

Solution 2

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.

Solution 3

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

Solution 4

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:
5,118

Related videos on Youtube

Admin
Author by

Admin

Updated on September 17, 2022

Comments

  • Admin
    Admin almost 2 years

    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

  • Kyle Brandt
    Kyle Brandt almost 15 years
    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?
  • Kevin Kuphal
    Kevin Kuphal almost 15 years
    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.