Git Product home page Git Product logo

ddns's Introduction

DDNS

中文|English

Summary

Python and Aliyun SDK API have been used in this project. You can use this tool to map the local applications like NAS, DB, WEB etc to the internet.

Install

pip3 install aliyun-python-sdk-core

Run

python3 src/DDNS.py      # default ipv4
python3 src/DDNS.py -6   # change to ipv6

Note

  • Based on Python3、Aliyun API.
  • To begin, you can run the main function in DDNS.py. The main function in other .py files are for the test purpose.
  • You can set this script as a timer task in your opening system. For example, running this script at 4:30am everyday or when connecting to the internet.
  • On the dev branch, this project supports binding multiple domains to the same ip address.
  • This script is my idea for implementing DDNS.

Restrict

This script is suitable for the broadband which has a dynamic IP. If not, you can try NAT-DDNS tools like frp.

Configuration

The config.json has some infomation you should provide. The config structure may like this:

{
    "AccessKeyId": "Your_AccessKeyId",//Your Aliyun AccessKeyId
    "AccessKeySecret": "Your_AccessKeySecret",//Your Aliyun AccessKeySecret
    "First-level-domain": "Your_First-level-domain",//First level domain, eg example.com
    "Second-level-domain": "Your_Second-level-domain"//Second level domain, eg ddns.example.com Just input ddns
}

Tip

How to determine wether your broadband service has a dynamic IP.

  • Step 1:Find your WAN IP by google or other tools.
  • Step 2:Run a web service locally. For example, starting IIS in Windows or Apache in Linux and using their default webpage.
  • Step 3: Set the map rules in your home router. The ports which you will use to access the local service over internet had better not to be 80 beacuse the 80 port may be blocked by your internet service provider.
  • Step 4: Use the IP you fond by google and the port to access your local web service. If ok, congratulations!

ScreenShots

NOTE: Because I have updated before, the script tells me the DNS record has already exists. Aliyun does not allow users to update the same IP when the IP has not been changed. The second picture shows the local service. The Third one shows accessing local service over internet under the help of DDNS.

Change Log

  • 2018/5/29 Add detecting internet access.
  • 2018/6/10 Start using configuration file.
  • 2018/9/24 Improve the error output
  • 2018/12/24 Improve the way to get IP, deleteing BS4 dependence. Thanks @Nielamu.
  • 2018/12/27 Support ipv6. Thanks @chnlkw.

Contribution

If you interest in this project and want to improve it, welcome to fork the project. Have any questions? you can ask in issue~

ddns's People

Contributors

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