Coder Social home page Coder Social logo

selectel-ddns's Introduction

Selectel DNS Updater

This is a Bash script for updating the A records of domains and subdomains on Selectel DNS. It compares the current public IP address of the machine running the script to the IP address in the DNS record and updates the DNS record if necessary.

Requirements

  • Bash shell
  • cURL command-line tool
  • JQ command-line tool
  • Selectel API token with the appropriate permissions

Installation

  1. Clone the repository or download the script file.

  2. Install the required packages.

    On Ubuntu or other Debian-based Linux distributions, you can install these packages using the following command:

    sudo apt-get install jq curl

    If you are using a different Linux distribution, you may need to use a different package manager or installation method.

  3. Rename .env.sample file to .env. Replace <your token here> with your Selectel API token, <main domain> with your root domain and <domains to update> with a space-separated list of domains and subdomains to update.

  4. Make the shell script executable by running the following command:

    chmod +x selectel-ddns

Usage

Run the script using the following command:

./selectel-ddns

The script will update the A record of each domain or subdomain in the list if the current IP address differs from the current external IP address.

Troubleshooting

  • If you encounter errors while running the script, check that all required dependencies are installed and that the .env file is present and contains valid values.
  • If you receive error messages from the Selectel API, double-check your API token.

selectel-ddns's People

Contributors

tonytkachenko avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.