Skip to content

dnsoumik/effective-winner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic DNS Updater

This script is designed to dynamically update a DNS record's IP address with your public IP address on a configured schedule. The script uses the GoDaddyPy library to interact with the GoDaddy API for managing DNS records. It checks for changes in your public IP and updates the DNS record accordingly.

Features

  • Automatically updates a specified DNS record with the current public IP address.
  • Configurable logging with file rotation.
  • Runs at a specified interval using the schedule library.
  • Creates the DNS record if it doesn't exist.
  • Uses GoDaddy API for DNS management.

Requirements

  • Python 3.x
  • schedule (for task scheduling)
  • pif (to retrieve the public IP address)
  • godaddypy (to interact with GoDaddy's DNS API)

Logging

The logging configuration is set up with a rotating file handler:

  • Log file path: ./log/dns_scheduler.log
  • Log rotation: The log file will rotate when it reaches 5MB, keeping up to two backup logs.

Schedule Configuration

Currently, the DNS update check runs every 5 seconds. To change this frequency, modify the schedule.every(5).seconds.do(job) line in the code.

Troubleshooting

  • DNS not updating: Ensure your GoDaddy API credentials are correct and have permission to modify DNS settings.
  • Logs not appearing: Check that the ./log directory exists and has write permissions.

Setup Instructions

  1. Install the required libraries:
   pip install schedule pif godaddypy
  1. Clone this repository to your local machine.

  2. Replace the following placeholder values in the script:

: The domain name you want to manage (e.g., example.com). : The subdomain (e.g., www, api) you want to update. Leave empty if it’s the root domain. PUB_KEY and SEC_KEY: Your GoDaddy API key and secret key, respectively. IP ADDR: Optionally, specify a static IP. The script will retrieve the IP automatically if this is left empty.

  1. Run the script:
python3 dns_scheduler.py

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages