Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2954  / 2 Years ago, tue, february 15, 2022, 8:10:09

Let's say my internal IP is 192.168.0.1



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 > 192.168.0.1


More From » minecraft

 Answers
6

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. 192.168.0.1. 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.


[#27273] Tuesday, February 15, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ingwhin

Total Points: 332
Total Questions: 112
Total Answers: 115

Location: Burkina Faso
Member since Tue, Apr 26, 2022
2 Years ago
;