Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to redirect a port, so say all traffic coming in on is rerouted to an ip (for example) I have access to an ubuntu box if needed, and access to'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. – Not Kyle stop stalking me 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... – Not Kyle stop stalking me 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
up vote 1 down vote accepted

You need to point to a Linux box you control, and then configure it to DNAT the packets to the server. First add an A record for 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.