Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Use linode's DNS API for dynamic DNS with curl from cron

Use Linode's DNS Manager API for one-line dynamic DNS

This can be useful for cron, for instance.


  • You are using Linode's DNS Manager to manage a zone for your domain
  • You have already created an A record for the name you want to make dynamic
  • You have an API key for Linode's API
  • curl and jsonpp (jsonpp is not necessary but makes the manual steps easier)


You need the DOMAINID and RESOURCEID for the A record you previously created. First, find the DOMAINID by listing all the domains you can manage:

$ curl -v -u u:THE_API_KEY '' | jsonpp

Let's say the DOMAINID you find is 10000.

Next, find the RESOURCEID for the A record you want to update dynamically. You do this by getting another list and looking through it:

$ curl -v -u u:THE_API_KEY '' | jsonpp

Let's say the RESOURCEID you find is 800.


Those two pieces of info, plus the API key and curl, are all you need to update that DNS record to point to the address from which the request originates:

$ curl -v -u u:THE_API_KEY '' | jsonpp

Re-get the resource info to see that it was updated:

$ curl -v -u u:THE_API_KEY '' | jsonpp


You can have the update run automatically every hour via your crontab:

$ crontab -e
# edit to contain:
0 * * * * curl -v -u u:THE_API_KEY '' > ~/dyndns.log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment