DNS A, CNAME to IP:Port

Discussion in 'Hosting Services / Control Panel' started by rikishipabst, Apr 9, 2008.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. We are getting ready to launch a new service that people will link to from a subdomain of our primary domain name. The new service is actually hosted by a different company for bandwidth reasons. I need to be able to create a DNS entry, A or CNAME is fine, that can point http://sub.domain.com to http://192.168.1.1:1234. I tried doing this in the DNS manager, however port numbers cannot be used. Anyone know of a work around to do this?

    FYI I do not have the ability to change the port number to 80 and the entire reason for doing this is that http://mydomain.com:1234 does not work with another system we are using and requires that only a FQDN be used.

    Thanks for any help or suggestions!

    Brent
     
  2. Hi Brent,
    Do you just need to redirect incoming traffic to the correct sub-domain or trick them?
    Note: I'm using the word "trick" loosely here, no disrespect is intended.
    Salute,
    Mark
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    Brent,

    DNS is for name resolution and you cannot configure an A record to resolve to an IP with a port number. This is just not how DNS work.
     
  4. Ok,

    Maybe the inclusion of the word "DNS" was not a good choice. What I need is a URL that can point to a port instead of having to specify it in the link. Like my previous post has http://mydomain.com:3690 is not good whereas http://sub.mydomain.com. I guess I could add a to my existing ASPX script for host header redirection and try that, however since this is a "service" where the client is constantly connected "think internet radio" I am not sure if that would work.

    Any ideas?
     
  5. Alright... ran a simple test and all appears good...

    Here's what I did:

    I have a script in my root level application directory that is set to load up when a user browses to one of my domains.

    I already have the scripts in there to redirect correctly depending on the host header value. I simply added another and pointed it to the IP and Port and ta-da it works.

    Looks something like this:

     
  6. Cool [​IMG]
     
  7. could you eleborate where you put this script, ie in the Default.aspx file of where?

     
  8. Sure Thing Bud...

    It is in a file called Default.aspx which has some simple VB code... which you saw in my example. It performs the logic in a big If, Then, ElseIf, Else statement. This file goes into your root directory on the web server... just make sure you have your default documents for the root directory to read the default.aspx page first.

    If you would like to see the file let me know and I can e-mail it to you if you'd like.

    Brent
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page