GithubHelp home page GithubHelp logo

visitishan / dynamic_dns Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 1.0 75 KB

A homemade Dynamic DNS tool for personal servers having dynamic IP.

Python 88.85% PHP 11.15%
ddns noip servers dynamic-dns tenda

dynamic_dns's Introduction

Dynamic_DNS

A homemade Dynamic DNS tool for personal servers having dynamic IP.

The idea is to have a simple tool that serves the purpose of DDNS and help a personal server to be always accessible from internet, even when the ip changes. Also it should be open source and is available for free.

How it works

A dynamic DNS host name or a domain name is linked up to the user's dynamic IP address. Whenever the IP changes, our dynamic DNS client will send an update to DDNS server with the current IP address and then the new ip is linked with your domain name. So whenever you access the ddns_server file using your domain name, it redirects the connection to the current Ip address of server.

There are some tools available already for DDNS like no-ip, but none of them seemed to work for me. Since my server is connected to a router, and not directly to the WAN, the no-ip tool updates my masked ip on the no-ip servers everytime.

My WAN ip -

Screenshot

What no-ip updates to their server -

Screenshot

So to have a solution for this, I started building something of my own.

The ddns_client.py script logs in into my Tenda WiFi router and scrapes out the current WAN ip assigned by the ISP. It then sends the WAN ip to the ddns_server.php script on a web server. The scraping and ip sending process is performed in every 2-5 minutes. The IP is recieved by ddns_server.php file and is then updated into a text file stored into the same directory. The ddns_server script is already linked with a Domain Name. So whenever the domain name is called, the ddns_server script reads back the ip text file and redirects the domain name to the current WAN ip. This is how, even after a new ip is assigned by my ISP, my server is still accessible.

This is just a basic solution that I found to solve the issue. If you have a better solution, your contributions are welcomed. ๐Ÿ˜Š

Note -

The client script is built for Tenda routers. You'll have to change the URLs if your router is from a different manufacturer. For Tenda stock firmwares, the default username is admin and password is encoded in base64 encoding. You'll need to change the login credentials with your's accordingly. The ddns_client.py script should be scheduled to always run on the server.

Solution 2 -

If you don't have a web hosting to host the ddns_server.php file, or if you don't want to use the custom server script, you can still use the no-ip server. I've built the noip_client.py script that sends the current ip to your no-ip account. However there are still few limitations from the no-ip's end like it's not completely free and their hostname expires in every 1 month. You'll need to change your hostname and authentication token in the script which is base64(your_noip_username:password).

dynamic_dns's People

Contributors

naveenkoti avatar visitishan avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

duc2ht

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.