Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to redirect a port, so say all traffic coming in on subdomain.xyz.com:2233 is rerouted to an ip (for example) I have access to an ubuntu box if needed, and access to xyz.com's DNS records, but i cannot change the port on the ip. Any help would be appreciated, thanks!

share|improve this question
forwarding ports isn't done from the web server or the DNS records you need access to the router or firewall. Make and model will help. –  Kyle Apr 18 '12 at 15:59
The gameserver isn't home hosted, its from a proffessional host. I need the IP and port changed to a subdomain and different port. I have access to the domain, and a linux box to route through, idk if it helps/is needed :) –  Adam Dodman Apr 18 '12 at 18:39
Yes the linux box as a router is pretty important... –  Kyle Apr 18 '12 at 18:43
The linux box isn't hosting the server, I just need info on how to route the ip through the server to change the ports. –  Adam Dodman Apr 18 '12 at 20:24

1 Answer 1

You need to point subdomain.xyz.com to a Linux box you control, and then configure it to DNAT the packets to the server. First add an A record for subdomain.xyz.com pointing to the Linux box. Then setup iptables with something like this:

iptables --table nat --append PREROUTING --protocol tcp --dport 2233 --jump DNAT --to-destination
iptables --append FORWARD --protocol tcp --ports 3344 --jump ACCEPT
share|improve this answer
Great, just what I needed. Thank you! –  Adam Dodman May 3 '12 at 14:21
You should accept his answer so we know a good solution was found to your problem :) –  Silver Quettier May 10 '12 at 6:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.