A great python/java dynamic DNS service for NameSilo, with log, email reminder...

Overview


简体中文 | English

NameSilo DDNS is a DDNS service for NameSilo domain names for home broadband , it can automatically detect IP changes in home broadband and automatically update the resolution of the domain name.

This project has been refactored via Python3, to view the Java version please switch branches.

This program is only available for domain names purchased on NameSilo.

This program obtains the public IP address of home broadband by visiting http://202020.ip138.com/, and queries and updates the DNS status by https://www.namesilo.com/api/.

It would be the best encouragement for me to get your STAR.

Features

  • Simple configuration, you can set the frequency of detecting IP changes and refreshing DNS.

  • With email alert function, you will be alerted when there is an abnormality in the process of the service running for a long time.

  • Support multi-platform (Linux, Windows...)

Table of Contents

Background

At present, telecom operators assign to home broadband IP are dynamic, although the IP address is not fixed, but the good thing is that the home router can get a real public IP, so we just need to use router NAT mapping (need router support, set up in the management console) to access the home device in the public network. After the router mapping port 22 we can remotely connect to our home linux machine, and after mapping port 445+3389 we can use the remote desktop of Win10.

网络拓扑图

To solve the problem of changing public IP, you can purchase a domain name and use DDNS (Dynamic Domain Name Server) to resolve the domain name to your broadband's IP. This will allow you to access your home devices by accessing a fixed domain name.

To achieve this, you need a computer that is always running to run this DDNS program.

Install

Download and use

git -b python clone https://github.com/Charles94jp/NameSilo-DDNS.git

Update

mv conf.json conf.json.back
git pull origin python
mv conf.json.back conf.json

Dependencies

A Python3 environment is required. The httpx module also needs to be installed.

pip install httpx

Usage

Configuration

The conf.json file needs to be configured before starting.

Fields Introduction
domain The domain name to be updated must be a subdomain. For example, if you purchase a domain name that is bb.cc, you must build a resolution on NameSilo for a subdomain such as aa.bb.cc.
key The key generated from NameSilo, after generation you need to remember and keep this key.
frequency How often do you detect changes in your ip, and only update your DNS when a change in ip occurs, in seconds.
mail_host For example, you can use Google Mail's POP/IMAP
mail_port
mail_user The login user name, which is also the email sender.
mail_pass passwd or key
receivers An array to hold the recipient's address.

The last five configurations are not required. Only after all five are filled in will the email alert feature be enabled.

Note

This program can only update the DNS record of a domain name, it cannot be added, please make sure this DNS record exists for your domain name and it needs to be a sub-domain.

Start

Direct start

python ddns.py

Linux usage:

chmod +x DDNS
./DDNS {start|stop|status|restart|force-reload}

Example

Windows usage: Double-click the bat or vbs file, please check the log for the running status of the program.

Start At Boot

Linux

Set up start at boot, only CentOS 7 is demonstrated, please write your own script for other Linux distributions.

First edit the DDNS file, change the 8th line to the path of NameSilo-DDNS project, change the 17th line to the path of python 3 executable file

Next, register DDNS as a service.

chmod +x DDNS
cp DDNS /etc/init.d/DDNS
chkconfig --add /etc/init.d/DDNS
# check
chkconfig --list

After registering DDNS as a service, you have finished setting the start at boot and you can use DDNS through service.

service DDNS {start|stop|status|restart|force-reload}

Windows

Add the vbs file to the Windows policy group.

You might also like...
Simple Python Script to Parse Apache Log, Get all Unique IPs and Urls visited by that IP

Parse_Apache_Log Simple Python Script to Parse Apache Log, Get all Unique IPs and Urls visited by that IP. It will create 3 different files. allIP.txt

A simple python script that parses the MSFT Teams log file for the users current Teams status and then outputs the status color to a MQTT connected light.

Description A simple python script that parses the MSFT Teams log file for the users current Teams status and then outputs the status color to a MQTT

Automatically block traffic on Cloudflare's side based on Nginx Log parsing.
Automatically block traffic on Cloudflare's side based on Nginx Log parsing.

AutoRL This is a PoC of automatically block traffic on Cloudflare's side based on Nginx Log parsing. It will evaluate Nginx access.log and find potent

Modern Denial-of-service ToolKit for python
Modern Denial-of-service ToolKit for python

💣 Impulse Modern Denial-of-service ToolKit 💻 Main window 📡 Methods: Method Target Description SMS PHONE Sends a massive amount of SMS messages and

Very simple and tiny file sharing service written in python

Simple File sharing tool Sharing client usage (You will need to use python3 for linux) main.py --send -f file/path Optionnal flags : pwd : set a passw

This script aims to make the dynamic public ip of your local server, public.
This script aims to make the dynamic public ip of your local server, public.

EZ DDNS CLOUDFLARE This script aims to make the dynamic ip of your local server, public. It does this by regularly updating cloudflare's dns record. B

Public HTTPS access to Home Assistant with Dataplicity service
Public HTTPS access to Home Assistant with Dataplicity service

Custom component for public HTTPS access to Home Assistant with Dataplicity service. Should work on any Linux PC or ARM, not only Raspberry as Dataplicity service said. Don't work on Windows.

Bark Toolkit is a toolkit wich provides Denial-of-service attacks, SMS attacks and more.
Bark Toolkit is a toolkit wich provides Denial-of-service attacks, SMS attacks and more.

Bark Toolkit About Bark Toolkit Bark Toolkit is a set of tools that provides denial of service attacks. Bark Toolkit includes SMS attack tool, HTTP

Client library for relay - a service for relaying server side messages to the client side browsers via websockets.

Client library for relay - a service for relaying server side messages to the client side browsers via websockets.

Comments
  • Image's platform does not match for Raspberry Pi 4

    Image's platform does not match for Raspberry Pi 4

    Greetings, I am trying to use DDNS in a docker container for namesilo using the docker run command provided in the github. My issue is that it seems like arm64/v8 isn't supported and there are only amd64 builds available. I am running a Raspberry Pi 4 via dietpi/raspbian. Any chance to add additional support for this?

    `[email protected]:~/docker# docker run -d --name ddns -v /docker/namesilo/:/home/NameSilo-DDNS:rw charles94jp/ddns

    --restart=always

    WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested e815e9a71dfd8c7cc7ed752086f299e90a854c726b9321e2a1938061e4a60c5d`

    Thank you

    opened by yslupdates 4
  • Feature Request: Update multiple sub-domains

    Feature Request: Update multiple sub-domains

    可以把 domain 字段设置为子域名数组吗?一次将多个域名 IP 地址更新为本机地址。

    Google Translate: Can the domain field be set to an array of subdomains? Update multiple domain IP addresses to local addresses at once.

    enhancement 
    opened by kongjun18 4
  • 随机出现SSL错误导致程序卡住

    随机出现SSL错误导致程序卡住

    目前我的解决方法是把**./NameSilo-DDNS/DDNS restart**做成定时任务 经常在日志中会各种出现SSL出错情况,类似

    Traceback (most recent call last):
      File "ddns.py", line 100, in __init__
        r = httpx.get("https://www.ip138.com/", headers=self.httpHeaders, timeout=10)
      File "/usr/local/lib/python3.8/dist-packages/httpx/_api.py", line 189, in get
        return request(
      File "/usr/local/lib/python3.8/dist-packages/httpx/_api.py", line 100, in request
        return client.request(
      File "/usr/local/lib/python3.8/dist-packages/httpx/_client.py", line 802, in request
        return self.send(request, auth=auth, follow_redirects=follow_redirects)
      File "/usr/local/lib/python3.8/dist-packages/httpx/_client.py", line 889, in send
        response = self._send_handling_auth(
      File "/usr/local/lib/python3.8/dist-packages/httpx/_client.py", line 917, in _send_handling_auth
        response = self._send_handling_redirects(
      File "/usr/local/lib/python3.8/dist-packages/httpx/_client.py", line 954, in _send_handling_redirects
        response = self._send_single_request(request)
      File "/usr/local/lib/python3.8/dist-packages/httpx/_client.py", line 990, in _send_single_request
        response = transport.handle_request(request)
      File "/usr/local/lib/python3.8/dist-packages/httpx/_transports/default.py", line 218, in handle_request
        resp = self._pool.handle_request(req)
      File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/local/lib/python3.8/dist-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
        raise mapped_exc(message) from exc
    httpx.ConnectError: EOF occurred in violation of protocol (_ssl.c:1131)
    
    opened by MarvinChiang 2
  • Does not support domain with both A and AAAA records

    Does not support domain with both A and AAAA records

    When I have "domains": [ "hpe.example.com" ], "domains_ipv6": [ "hpe.example.com" ], Every time fetching the current record, only A record will be returned, which then caused the program to update the A record with an ipv6 address and yields

    <?xml version="1.0"?>
    <namesilo><request><operation>dnsUpdateRecord</operation><ip>73.4.114.xxx</ip></request><reply><code>280</code><detail>2601:180:8300:1df6:b12d:3410:b7c5:xxxx must be a valid ipv4</detail></reply></namesilo>```
    opened by nightdawnex 5
Releases(v2.2.1)
  • v2.2.1(Aug 25, 2022)

    更新内容:

    ip138的接口被限流,同一个局域网访问10次左右就会被ban(即使是每隔10分钟访问一次)。影响:

    v2.2.0 由于有bug不可用。

    更旧的版本能启用备用api,但是是美国的api,可能会出现超时情况。

    Updates

    Fix the bug that appears in the program due to the ip138 api being limited in rate.

    Links

    Code for this version: https://github.com/Charles94jp/NameSilo-DDNS/tree/v2.2.1

    Docker Hub: https://hub.docker.com/r/charles94jp/ddns/tags

    Quick Start

    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(Aug 8, 2022)

    更新内容:

    1. 重构代码

    2. 代码变动:优化参数解析、删除email_after_reboot、邮件网络代理、更新docker镜像

    3. 支持IPv6

    4. 邮件内容支持英文,添加域名信息表

    Email content

    Updates

    1. Code refactoring.

    2. Code changes: optimize parameter parsing, deprecate email_after_reboot, mail network proxy, update docker image.

    3. IPv6 support.

    4. Email content support in English, add domain name information table.

    Links

    Code for this version: https://github.com/Charles94jp/NameSilo-DDNS/tree/v2.2.0

    Docker Hub: https://hub.docker.com/r/charles94jp/ddns/tags

    Quick Start

    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Jul 24, 2022)

    更新内容:

    1. 修复SSL链接错误、NameSilo record_id 过期问题等。提升程序稳定性

    2. 支持每次更新ip成功都发送邮件

    3. 域名格式从二级域名(cc.bb.aa),到支持多级域名(dd.cc.bb.aa)

    4. 支持同时更新多个域名

    5. docker 支持多平台

    Updates

    1. Fix SSL link error and NameSilo record_id expired bug. Improve the robustness of the program.

    2. Support sending email every time the domain name information is updated successfully.

    3. Change domain name format from second level domain name (cc.bb.aa) to multi-level domain name (dd.cc.bb.aa).

    4. Support update multiple domain names at the same time.

    5. Docker support multi-platform.

    Links

    Code for this version: https://github.com/Charles94jp/NameSilo-DDNS/tree/v2.1.0

    Docker Hub: https://hub.docker.com/r/charles94jp/ddns/tags

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Mar 11, 2022)

    更新内容:

    1. 重新组织了项目目录结构
    2. 支持Docker:https://hub.docker.com/r/charles94jp/ddns/tags
    3. 优化了程序

    注意:由于程序使用的api 2021.ip138.com 的域名发生了变更,新域名为2022.ip138.com,旧版程序已无法直接使用。v2.0.0版本能自动获取api域名,并添加了两个备用api。

    Code for this version: https://github.com/Charles94jp/NameSilo-DDNS/tree/v2.0.0

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Feb 6, 2022)

    完成以下功能:

    1. DDNS基本功能——循环检测IP变动并更新DNS
    2. 程序异常邮件提醒——包括调用第三方api时出现异常,服务器意外断电后,通电重启后的IP检测
    3. 针对Linux的脚本,包括开机自动启动,查询DDNS服务运行状态DDNS status
    4. 针对Windows开机自动启动的脚本

    Code for this version: https://github.com/Charles94jp/NameSilo-DDNS/tree/v1.0.0

    Source code(tar.gz)
    Source code(zip)
    NameSiloDDNS-1.0.0-linux.tar.gz(5.51 KB)
    NameSiloDDNS-1.0.0-windows.zip(5.27 KB)
Owner
云牧青
啥也不会
云牧青
Netwalk is a Python library to discover, parse, analyze and change Cisco switched networks

Netwalk is a Python library born out of a large remadiation project aimed at making network device discovery and management as fast and painless as possible.

38 Nov 07, 2022
Minimal, self-hosted, 0-config alternative to ngrok. Caddy+OpenSSH+50 lines of Python.

If you have a webserver running on one computer (say your development laptop), and you want to expose it securely (ie HTTPS) via a public URL, SirTunnel allows you to easily do that.

Anders Pitman 423 Jan 02, 2023
Easy-to-setup bot, ChatOps project for handling telegram chat logging over docker-compose services, being runned as one of them.

Easy-to-setup bot, ChatOps project for handling telegram chat logging over docker-compose services, being runned as one of them.

Rashid 7 Aug 08, 2022
TLD records archive. Revisiting the original TLDR project by mandatoryprogrammer, on the hunt for more root nameserver changes.

tldr A(nother) continuously updated historical TLD records archive. This repository is updated approximately every three hours with the results from D

Chris Partridge 11 Dec 14, 2022
A repo with study material, exercises, examples, etc for Devnet SPAUTO

MPLS in the SDN Era -- DevNet SPAUTO All of the study notes have now been moved to use auto-generated documentation to build a static site with Githu

Hugo Tinoco 67 Nov 16, 2022
InfraGenie is allows you to split out your infrastructure project into separate independent pieces, each with its own terraform state.

🧞 InfraGenie InfraGenie is allows you to split out your infrastructure project into separate independent pieces, each with its own terraform state. T

Digger 53 Nov 23, 2022
Load balancing DICOM router

dicom-loadbalancer Load balancing DICOM router (WORK IN PROGRESS) The DICOM loadbalancer provides functionality for acting as any number of DICOM SCPs

Søren Boll Overgaard 1 Jan 15, 2022
A server and client for passing data between computercraft computers/turtles across dimensions or even servers.

ccserver A server and client for passing data between computercraft computers/turtles across dimensions or even servers. pastebin get zUnE5N0v client

1 Jan 22, 2022
BaseSpec is a system that performs a comparative analysis of baseband implementation and the specifications of cellular networks.

BaseSpec is a system that performs a comparative analysis of baseband implementation and the specifications of cellular networks. The key intuition of BaseSpec is that a message decoder in baseband s

SysSec Lab 35 Dec 06, 2022
GhostVPN - Simple and lightweight TUI application for CyberGhostVPN

GhostVPN Simple and lightweight TUI application for CyberGhostVPN. Screenshot Us

Mehmet Ali KERİMOĞLU 5 Jul 27, 2022
A network address manipulation library for Python

netaddr A system-independent network address manipulation library for Python 2.7 and 3.5+. (Python 2.7 and 3.5 support is deprecated). Provides suppor

711 Jan 05, 2023
Repo for investigation of timeouts that happens with prolonged training on clients

Flower-timeout Repo for investigation of timeouts that happens with prolonged training on clients. This repository is meant purely for demonstration o

1 Jan 21, 2022
An API for controlling Wi-Fi connections on Balena devices.

Description An API for controlling Wi-Fi connections on Balena devices. It does not contain an interface, instead it provides API endpoints to send re

8 Dec 25, 2022
Domain To Api [ PYTHON ]

Domain To IP Usage You Open Terminal For Run The Program python ip.py Input & Output Input Your List e.g domain.txt Output ( For Save Output File )

It's Me Jafar 0 Dec 12, 2021
FramIp - it a framework for work at IP and domain

FramIp FramIp - it a framework for work with IP and domain Installation (termux) $ pkg install git && pkg install python && git clone https://github.c

1 Jan 28, 2022
Simple python script for automated network scans with random name generator(useful for CTF boxes).

📄 Automated NMAP script Description Simple python script for automated network scans with random name generator(useful for CTF boxes). Requirements 1

Dhmos Funk 2 Oct 29, 2021
ThorFI: A Novel Approach for Network Fault Injection as a Service

ThorFI: a Novel Approach for Network Fault Injection as a Service This repo includes ThorFI, a novel fault injection solution for virtual networks in

DESSERT research lab (Federico II University of Naples, Italy) 6 Dec 14, 2022
DataShare - Simple library for data sharing between scripts and public functions calling

DataShare - Simple library for data sharing between scripts and public functions calling. Installation. Install code, Delete LICENSE, README, readme.t

Ivan Perzhinsky. 1 Dec 17, 2021
Readable, simple and fast asynchronous non-blocking network apps

Fast and readable async non-blocking network apps Netius is a Python network library that can be used for the rapid creation of asynchronous non-block

Hive Solutions 120 Nov 20, 2022
A Scapy implementation of SMS-SUBMIT and (U)SIM Application Toolkit command packets.

A Scapy implementation of SMS-SUBMIT and (U)SIM Application Toolkit command packets.

mnemonic 83 Dec 11, 2022