Giter Club home page Giter Club logo

dynip's Introduction

dynip

Dynamically updates an Ubuntu Server's IP address on Google Domains

Using a combination of Bash and Python to automatically update a Google Domains DNS Record whenever your public IP changes for an Ubuntu Server (probably other unix systems as well). AKA DynamicDNS

This is only originally created to work with Google Domains, but could easily be adapted to any service taht offers an http accessible API if you know what you're doing. Look inside dynip.py for calling an API with python's requests module.

INSTALLATION AND SETUP

First things first, you need to create a Synthetic Record on Google Domains for your A record (choose the Dynamic DNS option) https://support.google.com/domains/answer/6147083

Download this git repository The folder can sit anywhere on the server. So place it where ever you want. Open dynip.sh with whatever text editor or interface you prefer (Atom / Nano / Vim / TextEdit / etc.) Change the path="" variable to the FULL path, wherever you put the dynip directory (including the dynlib directory)

Make a new file named dynip.conf, right in the dynip directory, and with whatever text editor or interface you prefer, add your "username", "password", and "domain" variables with the information from your domains.google.com account It should look something like "faF3dga9432GD jsfdk232rFDf33 website.org" Check out dynip.conf_example to see an even better example of what it should look like. "domain" does NOT include the sub domain of the synthetic record. Google figures that out using the "username" and "password"

Finally, you'll need to add a cron job by using "crontab -e" in terminal This will periodically run the dynip.sh script Add this line to the bottom, replacing [LOCATION] with the location of the dynip folder Again, this location needs to be the FULL path to your dynip directory You can change how often your machine checks it's own IP but changing the crontab entry. Changing "/10" to "/30" would tell the machine to update every 30 minutes instead of every 10 minutes.

*/10 * * * * /bin/bash /[LOCATION]/dynip.sh > /dev/null

That's all folks!

This will check your IP every 10 minutes, and update it on domains.google.com if it has changed.

dynip's People

Contributors

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