Code Monkey home page Code Monkey logo

ddnsupd's Introduction

ddnsupd

!!! Still in Developement!!!

Small Script for dynamic DNS updates

How does is work:

It uses nsupdate and DNSSEC keys to update or add a host entry to a bind DNS server zone file. Of course this can be done with nsupdate and a more static script but I have multiple domains and locked for a dyndns setup which doesn't require a subscription.

Recommendations

The script require nsupdate and wget to run. If not installed you can install them as following

sudo apt-get install dnsutils
sudo apt-get install wget

Client configuration:

  1. Clone the Github project
  2. Create a DNSSEC key e.g.
dnssec-keygen -a HMAC-MD5 -b 512 -n HOST domain.tld.
  1. Copy the Key to your clipboard to paste it later into your BIND conf file.
cat Kdomain.tld.+157+22940.key 
weflashit.de. IN KEY 512 3 157 kjldsjfieKJLKSDJLK§JLSJDLKSLKDNLKFLDKGLKJLS999F92CM0R0X39R3R0293==
  1. Make the ddnsupd.sh file executable
chmod +x ddnsupd.sh
  1. Test the script

This will update www.domain.tld to the current public IP of the client you running the script. -l will write an log output. Because -k is not specified the script search for a *.private file in the same folder of the script and use it in case there is just one found. As long as no -s is specified the primary nameserver of the domain will be picked out of the MNAME filed from the SOA record. Make sure this point to the right server.

./ddnsupd.sh -fv -D domain.tld -H www -l log.log

or using Batch-Mode by modify the example.conf file. After the domain name you can add multiple hostnames if you wish. All will be updated with the same IP in case you want to use multiple services with different names behind the same IP. E.g. smtp, www, imap...... Then run ddnsupd.sh as follows:

./ddnsupd.sh -f -c example.conf -A
  1. Create a cron job to continously keep the IP updated

BIND9 Server configuration:

Adjust named.conf and modify "allow-update" with the coresponding key from Step 1

zone "domain.tld" IN {
        type master;
        ...
        allow-update { key "domain.tld."; };
        ...
};

key "domain.tld." {
	algorithm hmac-md5;
	secret "<paste your Key here>";
};

The Zone File itself shouldn't containt the entry you like to dynamically add. The script will take care of and bind will update the zone file anyway.

ddnsupd's People

Contributors

edfauler avatar

ddnsupd's Issues

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.