Update the IP address of your A record of your GoDaddy domain every 5 minutes.
It uses bash and curl to communicate with the GoDaddy API, and is based on Alpine. The image is 10MB and requires 6MB of RAM.
- Login to https://developer.godaddy.com/keys with your account credentials.
- Generate a Test key and secret.
- Generate a Production key and secret.
Obtain the key and secret of that production key.
In this example, the key is dLP4WKz5PdkS_GuUDNigHcLQFpw4CWNwAQ5
and the secret is GuUFdVFj8nJ1M79RtdwmkZ
.
- Make sure you have Docker installed
- Obtaining the Docker image
- Option 1 of 2: Docker Hub Registry
-
You can check my Docker Hub page for more information.
-
In a terminal, download the image (10MB) with:
sudo docker pull qmcgaw/godaddy-ip-ddns
-
- Option 2 of 2: Build the image
- Download the repository files or
git clone
them - With a terminal, go in the directory where the Dockerfile is located
- Build the image with:
sudo docker build -t qmcgaw/godaddy-ip-ddns ./
- Download the repository files or
- Option 1 of 2: Docker Hub Registry
- Launching the Docker container from the image (replace the values below):
sudo docker run -d --name=godaddyddns --restart=always -e 'DOMAIN=mydomain.com' -e 'KEY=dLP4WKz5PdkS_GuUDNigHcLQFpw4CWNwAQ5' -e 'SECRET=GuUFdVFj8nJ1M79RtdwmkZ' -e 'NAME=@' -e 'DELAY=1200' qmcgaw/godaddy-ip-ddns
Note that we set the following container environment variables with the flag -e
:
Environement variable | Value | Optional |
---|---|---|
DOMAIN | Domain name | No |
KEY | Production key's key | No |
SECRET | Production key's secret | No |
NAME | @ | Yes, defaults to @ |
DELAY | 1200 | Yes, defaults to 300 |
You can also run the container interactively to test it with:
sudo docker run --rm --name=godaddyddnsTEST -e 'DOMAIN=mydomain.com' -e 'KEY=dLP4WKz5PdkS_GuUDNigHcLQFpw4CWNwAQ5' -e 'SECRET=GuUFdVFj8nJ1M79RtdwmkZ' -e 'NAME=@' -e 'DELAY=1200' qmcgaw/godaddy-ip-ddns
-
Set the necessary variables:
- Option 1 of 2: Set environment variables with a terminal:
DOMAIN=mydomain.com KEY=dLP4WKz5PdkS_GuUDNigHcLQFpw4CWNwAQ5 SECRET=GuUFdVFj8nJ1M79RtdwmkZ NAME=@ # optional DELAY=1200 # optional
- Option 2 of 2: Set variables in the shell script godaddyddns.sh
- Copy the following block of code:
DOMAIN=mydomain.com KEY=dLP4WKz5PdkS_GuUDNigHcLQFpw4CWNwAQ5 SECRET=GuUFdVFj8nJ1M79RtdwmkZ NAME=@ # optional DELAY=1200 # optional
- Paste it after the first line
#!/bin/bash
- Copy the following block of code:
- Option 1 of 2: Set environment variables with a terminal:
-
Make the script executable with:
sudo chmod +x godaddyddns.sh
-
Test the script by running it with:
./godaddyddns.sh
Refer to the Testing section to see the result.
-
Run the shell script with screen for example or as a service.
With a browser, go to https://dcc.godaddy.com/manage/yourdomain.com/dns (replace yourdomain.com) and check the Value of the record of type A is set to your current IP address
You might want to try to change the IP address to another one to see if the update actually occurs.