Let's say my internal IP is

And my external is 2.222.333.444

1.222.333.444 is dynamic and monitered everytime it changes to the hostname www.website.com

I want to link my external ip so that when I connect the hostname, it goes: www.website.com > 2.222.333.444 >

  • These commands may be useful. Check the settings you have set on your router, and with your Internet Service Provider. – Wilf Jan 26 '14 at 16:53

First, you need to register your domain (www.my-website.com) with a DNS provider that provides API access, such as Amazon Web Services (Route 53).

Then you need to have a little script on your home network that continuously checks your public IP, e.g. like the following bash command.

wget -O - -q icanhazip.com.

The script should detect if the IP has changed (different to cached value) and if so, uses the IP in an an API request to update the nameserver records.

Finally, you need to use port-forwarding on your router to route incoming requests to the static IP that you want to have handle the request, e.g. You will also need to keep your computers private IP the same by either setting static IPs or configuring whatever is providing your DHCP service (usually your "home hub"). Unfortunately all hubs have different features so I cannot help you there. For example, my BT hub can map the port forwarding to devices based on the MAC rather than to IP's, so you can still have a dynamic static IP.

I recommend AWS purely becuase they have lots of SDKs that accommodate a variety of languages, so you are likely to find one for your preferred language, however you would need to set up an account and it's not "free as in beer".

I only just noticed you have tagged the question "minecraft", in which case I highly recommend that instead you just get a VPS as this will have a much better upload speed as well as a much more reliable internet connection. e.g. the VPS will have a static IP so you won't have any downtime whilst nameservers get updated. It is also slightly more difficult to take a minecraft server offline with a DDoS attack than a home connection, depending on the provider you go with (some even offer DDoS protection as a product, which is beyond the scope of this answer).

If however you decide to continue down the home-hosting route, you will need to forward TCP port 25565 to your private IP on your router for Minecraft unless you change the default port on your server.


Easy as 1, 2, 3...

  1. Subscribe to a DNS service
  2. Install a DNS updater on your local network
  3. Route incoming traffic to desired computer

Subscribe to a DNS service

A Domain Name Server, or DNS, maps IP (external) addresses to domain names. While it is possible to create your own DNS, its best to leave this to the pro's such as:

  • DYN Remote access - This is what I use, $25 a year. You may provide your own domain name or select a sub-domain from one of there many domain's the own, (yourchoice.homedns.org). You're can route 31 different IPs.
  • no-ip - Has a three verison that can route 3 IPs, and you must use their domain names. Pay for version is $19. I've never used them, but they are very popular.
  • Amazon Route 53 - $0.50 per hosted zone / month for the first 25 hosted zones. Probably the cheapest route if you only need to route 1 IP.

You can't go wrong, just choose one and sign up! For more information on DNS see:


Install a DNS updater on your local network

Each of the above DNS service providers will provide software you can install that will automatically send your external IP address to their servers. This tools work well although your computer must always be one in-order to send the updates.

I however, would strongly suggest using your router instead, they consume little power, are always on, and more reliable then a computer. Most routers will allow you to insert your dyn (or other services) username and password, and it will do the rest. Some ISPs provide routers/modems that are unable/unwilling to do this. If this is your (or anyone else's case) just comment and I'll include those instructions.

After your either enter your credentials on your router or install an update client, log into your DNS account on you provider of choice's website and verify it is all working.

Route incoming traffic to desired computer

Your home network most likely has a router which is responsible for router incoming/outgoing traffic through certain ports through the router's firewall. The basic steps are:

  1. Determine required ports to forward. This is dependent upon the type of application, and who wrote the software, and how it is configured, but for mindcraft you need 25565. portforward.com provides resources for many applications.

  2. Log into your router

  3. Assign your computer a fixed IP address (you may use DHCP if it is capable of forwarding to a MAC address

  4. Forward desired ports to IP / MAC address

Additional Resources

This answer is meant to provide a broad overview of the required major steps, not the nitty-griddy detail. The specific tasks described have been answered many times over in other forms. If you are not able to find information on specific tasks post a comment to this question and I'll link the appropriate guides.

Also make sure to check out:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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