Link to home
Create AccountLog in
Avatar of KJCJK
KJCJKFlag for United States of America

asked on

Forward subdomain to port

I am trying to forward sub.domain.com to domain.com:1234. There is a java application that I want to run on port 1234 but i want users to use the subdomain. Any Ideas?
ASKER CERTIFIED SOLUTION
Avatar of RubalJ
RubalJ
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of gabbadar
gabbadar

You can create a subdomain in IIS, and forward using a script, as RubalJ suggests; but that is assuming the users will be connecting to this application through a browser.

If you have an available IP address, you could create a DNS record for sub.domain.com to that free IP address, then on the firewall forward any incoming sub.domain.com requests, on any ports, to domain.com:1234. Without assigning sub.domain.com to a separate IP address, there's no way to differentiate traffic coming in one subdomain from another unless it's inbound on a specific port.

That would be wasteful of an IP address, but the most braindead way for users to connect without providing the port number.
Avatar of KJCJK

ASKER

So how would you forward an incoming request for the subdomain? I know how to forward ports but not a subdomain.
You can't. There is no concept of subdomains on the network level. Which is why I would suggest using an entire IP address for the sub domain if you really needed to make it brainless for the user. You would then forward any requests on any ports from that IP address, to the regular domain's IP address, and the desired port.

First though, is this java application actually a web app? If it is, Rubals suggestion is better.