Dynadot: Skillnad mellan sidversioner
Utseende
Skapade sidan med '{{Short description|Dynadot Dynamic DNS setup and Ubuntu update script}} = Dynadot Dynamic DNS (DDNS) Setup = This page documents how to configure Dynamic DNS for Dynadot and automatically update the A record when the public IP address changes. == Requirements == * Dynadot account * Domain using ''Dynadot DNS'' * DDNS password generated in Dynadot * Ubuntu server with outbound HTTPS access == Dynadot configuration == === 1. Enable Dynadot DNS === # Log in to Dynadot...' |
|||
| Rad 71: | Rad 71: | ||
IP_FILE="/tmp/dynadot_last_ip.txt" | IP_FILE="/tmp/dynadot_last_ip.txt" | ||
CURRENT_IP=$(curl -s https:// | CURRENT_IP=$(curl -s https://checkip.amazonaws.com) | ||
if [ -z "$CURRENT_IP" ]; then | if [ -z "$CURRENT_IP" ]; then | ||
Versionen från 11 januari 2026 kl. 05.10
Dynadot Dynamic DNS (DDNS) Setup
This page documents how to configure Dynamic DNS for Dynadot and automatically update the A record when the public IP address changes.
Requirements
- Dynadot account
- Domain using Dynadot DNS
- DDNS password generated in Dynadot
- Ubuntu server with outbound HTTPS access
Dynadot configuration
1. Enable Dynadot DNS
- Log in to Dynadot
- Go to My Domains
- Click the domain
- Set DNS → Dynadot DNS
2. Enable Dynamic DNS
- Domain settings → Dynamic DNS
- Enable DDNS
- Generate a DDNS password
- Save it securely
3. Required values
| Field | Example |
|---|---|
| Domain | example.com |
| Subdomain | @ or www |
| Record type | A (IPv4) or AAAA (IPv6) |
| DDNS password | (generated in Dynadot) |
Dynadot update endpoint
Dynadot accepts HTTP GET updates:
https://www.dynadot.com/set_ddns
Parameters:
- domain
- subDomain
- type
- ip
- pwd
- ttl (optional)
Ubuntu auto-update script
Script: dynadot-ddns.sh
#!/bin/bash
DOMAIN="example.com"
SUBDOMAIN="@"
TYPE="A"
PASSWORD="YOUR_DDNS_PASSWORD"
TTL="300"
IP_FILE="/tmp/dynadot_last_ip.txt"
CURRENT_IP=$(curl -s https://checkip.amazonaws.com)
if [ -z "$CURRENT_IP" ]; then
exit 1
fi
if [ -f "$IP_FILE" ]; then
LAST_IP=$(cat "$IP_FILE")
else
LAST_IP=""
fi
if [ "$CURRENT_IP" = "$LAST_IP" ]; then
exit 0
fi
UPDATE_URL="https://www.dynadot.com/set_ddns?containRoot=true&domain=${DOMAIN}&subDomain=${SUBDOMAIN}&type=${TYPE}&ip=${CURRENT_IP}&pwd=${PASSWORD}&ttl=${TTL}"
curl -s "$UPDATE_URL" > /dev/null
echo "$CURRENT_IP" > "$IP_FILE"
Installation
1. Save script
sudo nano /usr/local/bin/dynadot-ddns.sh
Paste script and edit variables.
2. Make executable
sudo chmod +x /usr/local/bin/dynadot-ddns.sh
3. Test manually
/usr/local/bin/dynadot-ddns.sh
4. Add cron job (every 5 minutes)
crontab -e
Add:
*/5 * * * * /usr/local/bin/dynadot-ddns.sh
Security notes
- Store DDNS password securely
- Limit file permissions
- Do not commit the script to public repositories
References
- Dynadot Help – Dynamic DNS
- Dynadot API documentation