Code Monkey home page Code Monkey logo

active24soap's Introduction

active24Soap

Python script for updating DNS records on Active24.cz

With this script you can update A and AAAA records on active24.cz, you need to enter your login and password, name of the domain, name of DNS record and IP address. If IP address is not set, script uses dig to find out what your public IP is and sets that instead. If no TTL is set, this won't change.

You can use this script to dynamically change your IP of your machine using cron.

Requirements

  • python2 or python3
  • suds-jurko
  • argparse

Installation

get script copy

git clone https://github.com/ra100/active24Soap

install required libraries

pip3 install suds-jurko
pip3 install argparse

Usage

Show help ./active24 -h

usage: active24.py [-h] -l LOGIN -p PASSWORD -d DOMAIN [-r [{A,AAAA}]]
                   [-i [IP]] -n NAME [-t [TTL]] [-a [{UPDATE,CREATE,DELETE}]]

Updates DNS record on Active24, if IP is not set, sets public IP. Updates
record only if IP and TTL are different than already set.

optional arguments:
  -h, --help            show this help message and exit
  -l LOGIN, --login LOGIN
                        Active24 login name
  -p PASSWORD, --password PASSWORD
                        Active24 password
  -d DOMAIN, --domain DOMAIN
                        Domain name
  -r [{A,AAAA}], --record [{A,AAAA}]
                        Record type, default=A
  -i [IP], --ip [IP]    IP address
  -n NAME, --name NAME  DNS record name (without domain)
  -t [TTL], --ttl [TTL]
                        TTL in seconds, if empty, uses TTL from DNSrecord
  -a [{UPDATE,CREATE,DELETE}], --action [{UPDATE,CREATE,DELETE}]
                        Action type, default=UPDATE
  • LOGIN - your active24 username
  • PASSWORD - your active24 password
  • DOMAIN - domain name you want to work with, e.g. ra100.net
  • A, AAAA - DNS record type you wish to change
  • NAME - name of DNS record, e.g. for awesome.ra100.net it will be 'awesome'
  • IP - (optional) IP address in format xxx.xxx.xxx.xxx, if not set, your public IP will be used
  • TTL - (optional) TTL value, if not set, value from DNSrecord will be used
  • ACTION - (optiona) UPDATE, CREATE or DELETE record

By default works with python3, to run with python2 use:

python2 active24 -h

cron example

add this to /etc/crontab or other equivalent file

*/5 * * * * root /path/to/python /path/to/script/active24.py -l USERNAME -p PASSWORD -d example.cz -r A -n sub

This will check every 5 minutes public IP of machine, check it against DNS records and when it's different, it updates that record.

bugs

CREATE method is not working suds.WebFault: Server raised fault: 'java.lang.NullPointerException'

active24soap's People

Contributors

ra100 avatar vician avatar

Watchers

 avatar  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.