Free Static IP: How to Use DuckDNS on Your Minecraft Server
One of the biggest problems for those hosting a server at home is Dynamic IP. Most internet providers change your IP address every time the router is restarted. This means that whenever this happens, you need to find your new IP and notify all your friends.
The solution for this is Dynamic DNS (DDNS). In this guide, we will teach you how to use DuckDNS, a completely free tool that creates a fixed address (like myserver.duckdns.org) that updates itself whenever your IP changes.
1. Creating Your DuckDNS Account
DuckDNS is famous for its simplicity. It doesn't require long registration forms:
- Access the official site: duckdns.org.
- Log in using one of your accounts (Google, Reddit, Github, etc.).
- In the "sub domain" field, choose a name for your server and click "add domain".
- Done! You now have a domain. Note down your Token (a sequence of letters and numbers that appears at the top of the page), as we will need it.
2. How to Keep the IP Automatically Updated
Having the domain is useless if it doesn't know when your IP has changed. For this, we will use a small script that runs on your Windows:
- Create a new folder named
DuckDNSon your computer. - Inside it, create a file named
duckdns.batusing Notepad. - Paste the following code (replacing the fields):
@echo off
echo url="https://www.duckdns.org/update?domains=YOUR_DOMAIN&token=YOUR_TOKEN&ip=" | curl -k -o duck.log -K -
Replace YOUR_DOMAIN with the name you created (just the name, without .duckdns.org) and YOUR_TOKEN with the code you noted in Step 1.
3. Automating with Task Scheduler
To avoid having to click the .bat file every time, we will make Windows run it automatically every 5 minutes:
- In the start menu, type Task Scheduler and open it.
- Click "Create Basic Task" in the right panel.
- Name it "Update DuckDNS" and proceed.
- In the trigger, choose "When the computer starts".
- In the action, choose "Start a program" and select your
duckdns.batfile. - After finishing, open the task properties and, in the "Triggers" tab, edit the trigger to "Repeat task every 5 minutes".
4. Testing the Connection
Now, instead of giving a complicated number (like 187.54.22.10) to your friends, you will just give them myserver.duckdns.org.
Note: DuckDNS only solves the address problem. You still need to have ports opened on the router for the connection to work!
Conclusion
Using a DDNS like DuckDNS professionalizes your home server and avoids the hassle of manually updating the address. It's a setup you do once and never have to worry about again.
If you set up the address but your friends still can't enter, check our guide on how to identify network issues (CGNAT).