Bobcares

Linode Dynamic DNS | Beginners Guide

by | Aug 1, 2022

Linode Dynamic DNS sets the IP of Linode DNS records dynamically. Bobcares, as part of our Server Management service, responds to all your DNS related inquiries, large or small.

Related Product Linode Server Management

SEE PRODUCT FEATURES

What Is Linode Dynamic DNS?

In simple words, it is a DNS that sets the IP for Linode records flexibly. We can update Linode DNS records with the local IPv4 and IPv6 addresses.

For the Linode Dynamic DNS to work, the following are the pre-requisites.

Pre-requisites: The script uses the Linode-Python module and needs a Linode API key. We can generate the API key in our Linode panel profile. We also require the IDs of the objects that need to modify. All domains and entries registered in the Linode account are listed in the code below:

from linode import api
linode = api.Api('YOURAPIKEY')
for domain in linode.domain_list():
print domain['DOMAINID'], domain['DOMAIN']
for record in linode.domain_resource_list(domainid=domain['DOMAINID']):
print record['TYPE'], record['NAME'], record['TARGET']

We also need another URI from a web service that outputs the IP address in plain text. The PHP script below allows us to change the host or host our own:


Download: We can download the source code of Linode DNS from linode-dyndns. The py launcher is available in the public domain. The latest version can also be found at official mercurial repositories.

Usage

In the domain, create an AAAA entry. Use the list script mentioned above to display resource IDs. Edit the script’s initial variables, then execute it:

support@bobcares:/usr/local/bin$ ./linode-dyndns.py
2013-07-07 22:48:23 INFO: Registered IP address is 1.2.3.4, setting to 123.192.131.65
2013-07-07 22:48:25 INFO: IP address successfully updated!

Copy script to /usr/local/bin/ and create a crontab entry to run it every 6 hours:

0 */6 * * * /usr/local/bin/linode-dyndns.py &2>> /tmp/linode-dyndns.log

 

Systemd Service

The systemd directory of Linode dynamic DNS contains sample files for a timer and also a systemd service.

  • Firstly, copy the .service and .timer files into /etc/systemd/system and the .conf into /etc.
  • Then as needed, modify the configuration file.
  • To activate the service, execute the below code:
    systemctl daemon-reload
    
    systemctl enable linode-dynamic-dns.timer
    
    systemctl start linode-dynamic-dns.timer
    
    systemctl start linode-dynamic-dns.service

[Looking for a solution to another query? We are just a click away.]

Conclusion

From the article, we see how we can dynamically set the IP of Linode Dynamic DNS records. To conclude, our Support team went over the details including the use of it.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

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

Never again lose customers to poor
server speed! Let us help you.