How to Set Up Dynamic DNS for Your Minecraft Server
Step-by-step guide to configuring dynamic DNS for a home-hosted Minecraft server, free DDNS providers, client setup, SRV records, and automatic IP updates.
The Problem with Home IP Addresses
Most residential internet connections use a dynamic IP address, your ISP assigns you a public IP that can change at any time, typically when your router reboots or your DHCP lease expires. If you are hosting a Minecraft server from home, this means the IP your players use to connect could stop working overnight. Dynamic DNS solves this by giving you a hostname that automatically updates whenever your IP changes.
How Dynamic DNS Works
A dynamic dns minecraft server setup has three components:
- A DDNS hostname, a domain like
myserver.duckdns.orgthat points to your current public IP. - An update client, software running on your network that detects IP changes and pushes the new address to the DNS provider.
- The DNS provider, a service that hosts the DNS record and accepts automated updates via an API.
When your IP changes, the client notices within minutes, pushes the new IP to the provider, and the hostname resolves to the correct address. Your players always connect using the hostname, never the raw IP.
Step 1, Choose a DDNS Provider
Several reputable providers offer free tiers:
- Duck DNS, completely free, open-source, supports subdomains under
duckdns.org. Simple API, easy to automate. - No-IP, free tier requires monthly confirmation. Offers more hostname options.
- Cloudflare, if you own a domain, you can use Cloudflare's API to update A records dynamically. This gives you a clean custom domain instead of a third-party subdomain.
- DynDNS / Dynu, established providers with free and paid tiers.
For most home Minecraft servers, Duck DNS is the simplest choice. This guide uses Duck DNS as the primary example.
Step 2, Register a Hostname
Go to duckdns.org and log in with a GitHub, Google, or Reddit account. Create a subdomain, for example, mymc.duckdns.org. Duck DNS will show your current public IP and a token for API access. Save the token securely.
Step 3, Install the Update Client
Linux (Cron + Curl)
The simplest dynamic dns minecraft server client on Linux is a cron job that calls the Duck DNS API every 5 minutes:
mkdir -p ~/duckdns
cat > ~/duckdns/duck.sh <<'SCRIPT'
#!/bin/bash
echo url="https://www.duckdns.org/update?domains=mymc&token=YOUR_TOKEN&ip=" | curl -k -o ~/duckdns/duck.log -K -
SCRIPT
chmod +x ~/duckdns/duck.sh
Add it to crontab:
crontab -e
# Add this line:
*/5 * * * * ~/duckdns/duck.sh >/dev/null 2>&1
Replace mymc with your chosen subdomain and YOUR_TOKEN with the token from Duck DNS. The script runs every 5 minutes, checks your public IP, and updates the DNS record if it has changed.
Windows
Download the Duck DNS Windows client or use a scheduled task with PowerShell:
Invoke-RestMethod "https://www.duckdns.org/update?domains=mymc&token=YOUR_TOKEN&ip="
Schedule this in Task Scheduler to run every 5 minutes.
Router-Level DDNS
Many routers have built-in DDNS support. Check your router's admin panel under WAN or Dynamic DNS settings. If your router supports Duck DNS or No-IP natively, configure it there, this is the most reliable option because the router updates the IP even if your server machine is off.
Step 4, Test the Setup
After the first update runs, verify the hostname resolves correctly:
nslookup mymc.duckdns.org
# or
dig mymc.duckdns.org +short
The returned IP should match your current public IP (check at ifconfig.me). Give players the hostname mymc.duckdns.org instead of your raw IP. Minecraft Java Edition resolves hostnames natively.
Optional, SRV Records for Custom Ports
If you run your server on a non-standard port (not 25565), you can create an SRV record so players do not need to type the port. This requires owning a domain and using a DNS provider that supports SRV records (Cloudflare does). The record looks like:
_minecraft._tcp.play.yourdomain.com. 86400 IN SRV 0 5 25570 mymc.duckdns.org.
Players connect to play.yourdomain.com and DNS handles the port redirect transparently. For full port forwarding details, see our port forwarding guide.
Troubleshooting
- Hostname still shows old IP: DNS propagation can take up to 5 minutes. Also verify your cron job is actually running with
cat ~/duckdns/duck.log, it should sayOK. - Players cannot connect via hostname: ensure port 25565 is forwarded to your machine (see port forwarding guide) and your firewall allows inbound traffic.
- ISP uses CGNAT: if your public IP starts with
100.64.x.x, your ISP is using carrier-grade NAT and port forwarding will not work. Contact your ISP to request a real public IP, or consider a TCP tunnel solution like Playit.gg.
Summary
Setting up dynamic dns minecraft server takes about 10 minutes and saves you from the headache of constantly sharing new IP addresses. Combine it with IP protection for a more secure home hosting setup.
Skip the home server hassle, Astroworld Hosting handles hardware, DDoS protection, and backups so you can focus on your community.