How-to: setup DDNS client to update A record with your public IP with domain.

Guide on how to setup a linux server as DDNS Client for your domain.

Table of Contents

Why would you do this?

Here is one example. This is my use case.
At home, my WAN connection is DHCP and I have multiple uplinks. So my external IP changes quite a bit.
I use DDNS when connecting to my VPN server at home. When I’m at work or school, I type in my VPN client. I don’t have to worry about my IP changing at home.


  • You need a domain from
    This guide is based on their API.
  • You need a Linux server available inside your network.
  • This guide is not for lazy people. I make you do a lot of the work yourself 😉

Step 1. Create Python script that updates the A record.

from requests import get
import os

command = "curl -s -u \"ACCOUNTNAME:PASTE_YOUR_API_KEY_HERE\" \"\""

stream = os.popen(command)
output =
# Example on how to construct the curl command
command = "curl -s -u \"ACCOUNTNAME:nFTort8fghjjYXDEIQds45u8\" \"\""

Step 2. Use Cron to automatically run the script

For this idea to make sense, you want your server to run this script every x minutes.
With linux, this is very easy.

Btw crontab -e uses vim by default. Here is a guide on how to change that: link.

Open your shell and type “crontab -e”.

Cronjob template:

15 * * * * /usr/bin/python full_path_to_your_script >/dev/null 2>&1

This means the script will run every hour when the clock is xx:15.
>/dev/null 2>&1 means the output of the cronjob gets deleted. By default, you get a mail every time the cronjob runs.

This is a calculator for the time settings: link.

Step 3. Done

This is not the most thorough guide in the world. If you want me to add something to the guide or need help. Feel free to write a comment or contact me.


Leave a Reply

Your email address will not be published. Required fields are marked *