GithubHelp home page GithubHelp logo

johnsmol / netlify-ddns Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 10 KB

Python script to automatically create/update a Netlify DNS record for the specified domain

License: MIT License

Python 100.00%
ddns ddns-script netlify python python3 netlify-api

netlify-ddns's Introduction

Netlify DDNS

So you manage to get yourself a nice home lab or a beautiful Raspberry Pi and now you would like to expose your services to the public Internet for you, or others, to access them from everywhere in the world. However, your ISP doesn't provide you with a static public IP address, and you don't want to pay for a DDNS service.

Well, this Python script might be a good solution for you, if you have a domain and you use Netlify to manage your DNS.

This Python script makes use the Netlify public API and allows you to create and automatically update a Netlify DNS 'A' record associated to the specified domain in order for it to always point to the public IP of the system the script is running on.

In this way, you won't have to worry anymore about what your public IP is and just use a dedicated domain to point at your server to access the exposed services or the system itself.

Requisites

  • Having a registered domain
  • Using Netlify as your DNS manager

Usage

Simply copy the content of example.env into .env inserting you Netlify API token and the fully qualified name for which you want to create the DNS A record on Netlify.

There's no need to create the record manually before the first execution. The script will create it for you. If it already exists, it will update it if your public IP address is different from the one shown in the current record for the specified domain.

Since your public IP may change unexpectedly over time, it might be good to invoke this script with a cron job, in order to always have an updated dns record and avoid downtimes reaching your services.

In case you automate the process it's important to note that the Netlify public API is rate limited to 500 requests per minute. However, for DDNS purposes, an interval of one execution every 5 minutes is more than enough (and probably even a little overkill).

The script will create a netlify_ddns.log file for you to monitor the process and debug possible errors. Log rotation is configured so that every week a new file is generated with a retention of up to three weeks.

Useful resources

  • Guide to set up cron jobs on ubuntu: link
  • Tool to create cron schedules: link

netlify-ddns's People

Contributors

dependabot[bot] avatar johnsmol avatar

Watchers

 avatar

netlify-ddns'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.