Subdomain to IP+Port

CloneageDK

New member
Hello there.

I know this may not be a forum for this sort of thing, but seeing as there's so many experienced members I thought I'd give it a go.

First a little backstory...

I run several servers with Garrys Mod, Minecraft, CS:S and so on. To connect to them, you write in the IP and port of the server, like this:" 1.2.3.4:12345".

I wanted that changed to something more professional like "css.domain.com" to connect to a CS:S server.

I asked the host of my domain and forum if it was possible to send people who writes "css.domain.com" to a specific IP and port. They then responded yes, asked for my IP and made a subdomain wildcard, so that no matter what you write in front of ".domain.com", eg.: "sub.domain.com", it'll send people to my own external IP. Great.

But how the *censored* do I continue from there?

How can I make it so that when someone writes css.domain.com, they get sent to the IP and port of the CS:S server?

The support from my hosting is... Well, limited. And googling my problem I do find others in somewhat the same situation, but always without answers.

I'll gladly admit it, I'm no genius at this. I can't comprehend how to do this.

In other, hopefully more meaningful words:

The host who hosts my forum has made a wildcard for all subdomains, so that every single request made out to "*.domain.com" gets directed to my own external IP. I then want to redirect that, so that when "css.domain.com" is entered, people gets sent to the IP and port of a CS:S server.

Does anyone know if this is possible and if so, how?

Thank you in advance for any replies ^^
 
No expert, but have a look at your modem settings and see if you have a "Port Forwarding" page. Might be able to do something there.
 
With no port specified it goes to port 80. In the address bar you would need to specify :port after the address. You could do a redirect with a webpage, but for CSS that won't work. They would need to specify the address and port number. No way around that that I'm aware of. You could have a firewall do that with port forwarding, but that will forward any port 80 web traffic to a different port, not just a subdomain.
 
Hmm... Sad... But thanks for the answers. I feel very alone in this quest of mine, so it's nice to get some proper feedback.

It seems I was greatly misinformed ^^

My host said it was possible, though without telling me how.

The webpage redirect is easy, but as you're saying wouldn't work for this.

Tech support did mention a little about portforwards in a firewall.

Forwarding all port 80 webtraffic isn't going to be a problem, but I don't know how to do it so that traffic from a specific subdomain gets forwarded to a specific port, since I'd like multiple subdomains forwarded to multiple ports. Or if it's even possible to do that.

Does anyone know how other communities and the like can use subdomains to point to their IP's for their gameservers?

Are they using a different IP for each server or using a firewall like what's being suggested here?

And again, thanks for the answers. It's always nice to get an answer, even though it isn't a 1-2-3 guide on how to solve it. Thumbs up!
 
Subdomains are all in the DNS records. A subdomain may point to he same IP, then the webserver directs it to the proper directory. Or, the subdomain may point to a different IP. You may be able to use DNS records for port redirection as well. Your host takes care of your DNS so they would be the ones to add this. Unfortunately, that sends you back to asking them questions. If they can't help you out, might be time to get a new host.

Edit: I've never used this company before, but they claim to do what you need.

http://freedns.afraid.org/
 
you can set an A(address) record to point to an IP if u want to use a dns name

if you own a domain and have hosting you probably have the ability to do it already

in terms of ports, depends on the client connecting. eg: css will default to 27015 and webbrowsers 80 etc etc.

So if you have a CSS server running on a default port (27015) you can point the A record to it and connect without the need of a port.

*if it's not the default port you can just add it to the end as you would with the IP (eg: css.domain.com:27016)



If it was me I'd have the main domain pointing to webhosting, then for dedi servers etc just setup A records as sub domains to the IP's.

Verious reasons, but mainly due to security.
 
Subdomains are all in the DNS records. A subdomain may point to he same IP, then the webserver directs it to the proper directory. Or, the subdomain may point to a different IP. You may be able to use DNS records for port redirection as well. Your host takes care of your DNS so they would be the ones to add this. Unfortunately, that sends you back to asking them questions. If they can't help you out, might be time to get a new host.

Edit: I've never used this company before, but they claim to do what you need.

http://freedns.afraid.org/

My host set up a wildcard so that all subdomains gets forwarded to my own IP / webserver. Which is part of the solution.

But DNS records won't help me with the ports. At least not to my knowledge ^^

It's been time to change my host since I started using them. Their support is lacking, their servers are slow and sometimes my site will be down for a couple of minutes to a couple of hours without anyone knowing why.

I'll check out the company. Thanks for the link.

you can set an A(address) record to point to an IP if u want to use a dns name

if you own a domain and have hosting you probably have the ability to do it already

in terms of ports, depends on the client connecting. eg: css will default to 27015 and webbrowsers 80 etc etc.

So if you have a CSS server running on a default port (27015) you can point the A record to it and connect without the need of a port.

*if it's not the default port you can just add it to the end as you would with the IP (eg: css.domain.com:27016)



If it was me I'd have the main domain pointing to webhosting, then for dedi servers etc just setup A records as sub domains to the IP's.

Verious reasons, but mainly due to security.

I have one Source server running at the default port, so that one would work. And as you say, you could just type the port number at the end of the address for all the other ones.

And I'm not hating that solution, in fact it works like that now, but you know... It looks better without the port number xD

I read something about a DNS server called "BIND" would be able to do what I'm asking. So I'll try looking into that and see what I come up with.

And again, thanks for taking the time to help me out.
 
Back
Top