This tool will automatically update the DNS records for the specified hosts with the latest IP address of the host machine when the IP address changes (when the host machine has a dynamic IP rather than static).
You will need to use separate scheduling software to automate the script (e.g. cron is what I use (on linux)).
The script is written in Python, so you'll have to have that installed: Download Python
Note: The Dynamic DNS feature is available only for domains pointed to Namcheaps BasicDNS, PremiumDNS or FreeDNS.
The API used to get the machines current IP: ttps://ip-api.com (3rd party API - I have no affiliation with the creators)
- Download the files from the github repository
- Extract the zipped folder that was downloaded and move the "script.py", "last.ip" & "run.log" files to a directory of your choice.
- Ensure the script.py file has permissions to read and write to the "last.ip" & "run.log" files.
- Move onto getting your Namecheap API key
- Login to your namecheap dashboard.
- Go to Account -> Dashboard -> find your domain name -> Manage
- Scroll down to Nameservers and ensure your domain is using the Namecheap BasicDNS, PremiumDNS or FreeDNS. If not, it will need to be set to one of these to enable the dynamic DNS feature.
- Click on the Advanced DNS tab and scroll down to Dynamic DNS.
- Change the status to ON/Enabled.
- Copy the Dynamic DNS Password and note it down.
- Move onto Script Configuration
- Open the "script.py" file you downloaded and moved to your chosen directory in a suitable editing program of your choice.
- Under "#NAMECHEAP INFO - ensure no spaces" add your hosts in the array. Each host should be contained with double quotation marks and separated with a comma (but not after the last host). For Example: hosts = ["@", "www", "subdomain1", "subdomain2"]
- Set the "domain_name = 'enterhere.com.au'" variable to the domain name you have registered in namecheap (without any subdomain/host - i.e. not "www.yourdomain.com.au", only "yourdomain.com.au"). Ensure no spaces.
- Set the "dynamic_dns_password = 'enterhere'" variable to the dymanic DNS password you copied off of the namecheap dashboard earlier.
- Save and close the "script.py" file.
- Finally, use a third party piece of software to schedule the script to run every so often. For example, you could you cron on linux to schedule it. (look up cron linux)