The Why?
The short and sweet of it is that we want to update a Linode DNS A record to the latest dynamic IP of your server it is assigned to. This can be a home server or a remote branch office server and much much more.
We will leverage this using Ansible playbooks that will retrieve your IP address externally and then return your IP and then call’s the Linode API to update the A record using Ansible. It will also schedule a cron job to ensure that the DNS record is constantly updated
Prerequisites:
- Linode account and Domain using Linode Name Servers.
- External Linux Apache web server with PHP installed to host code to return your current IP.
- Linux Ansible installed on remote server that you want the external IP for.
- Basic understanding of how API’s work and working with Linodes. Recommended reading Linode API Document that can be found here: https://www.linode.com/docs/api/#tag/domains
- GIT clone of my code: https://github.com/akelling/ansible-linode-DNS-updater
- I HIGHLY recommend cloning this in your home users directory under ~/git/ for everything to work out of the box