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
云牧青
啥也不会
云牧青
Simple reverse backdoor utility, that uses sockets to communicate.

reverse_backdoor Simple reverse backdoor utility, that uses sockets to communicate. How to use Run rev_bd_listener.py using command below: $ python3 r

1 Dec 10, 2021
A simple framwork to streamline the Domain Adaptation training process.

FastDA Introduction This is a simple framework for domain adaptation training. You can use it to build your own training process. It heavily relies on

Vincent Zhang 7 Nov 22, 2022
This is an open project to maintain a list of domain names that serve YouTube ads

The YouTube ads blocklist project This is an open project to maintain a list of domain names that serve YouTube ads. The original project only produce

Evan Pratten 574 Dec 30, 2022
Rufus is a Dos tool written in Python3.

🦎 Rufus 🦎 Rufus is a simple but powerful Denial of Service tool written in Python3. The type of the Dos attack is TCP Flood, the power of the attack

Billy 88 Dec 20, 2022
This Tool can help enginners and biggener in network, the tool help you to find of any ip with subnet mask that can calucate them and show you ( Availble IP's , Subnet Mask, Network-ID, Broadcast-ID )

This Tool can help enginners and biggener in network, the tool help you to find of any ip with subnet mask that can calucate them and show you ( Availble IP's , Subnet Mask, Network-ID, Broadcast-ID

12 Dec 13, 2022
A Python library to utilize AWS API Gateway's large IP pool as a proxy to generate pseudo-infinite IPs for web scraping and brute forcing.

A Python library to utilize AWS API Gateway's large IP pool as a proxy to generate pseudo-infinite IPs for web scraping and brute forcing.

George O 929 Jan 01, 2023
sync application configuration and settings across multiple multiplatform devices

sync application configuration and settings across multiple multiplatform devices ✨ Key Features • ⚗️ Installation • 📑 How To Use • 🤔 FAQ • 🛠️ Setu

Souvik 6 Aug 25, 2022
Huawei firewall automatically updates Chinese ip to target IP group.

Huawei firewall automatically updates Chinese ip to target IP group.

Lundaa 0 Jan 11, 2022
SocksFlood, a DoS tools that sends attacks using Socks5 & Socks4

Information SocksFlood, a DoS tools that sends attacks using Socks5 and Socks4 Requirements Python 3.10.0 A little bit knowledge of sockets IDE / Code

ArtemisID 0 Dec 03, 2021
Monitoring plugin to check network interfaces with Icinga, Nagios and other compatible monitoring solutions

check_network_interface - Monitor network interfaces This is a monitoring plugin for Icinga, Nagios and other compatible monitoring solutions to check

DinoTools 3 Nov 15, 2022
Visualize the electric field of a point charge network.

ElectriPy ⚡ Visualize the electric field of a point charges network. 🔌 Installation Install ElectriPy package: $ pip install electripy You are all d

Dylan Tintenfich 29 Aug 29, 2022
Arp Spoofer using Python 3.

ARP Spoofer / Wifi Killer By Auax Run: Run the application with the following command: python3 spoof.py -t target_ip_address -lh host_ip_address I

Auax 6 Sep 15, 2022
RollerScanner — Fast Port Scanner Written On Python

RollerScanner RollerScanner — Fast Port Scanner Written On Python Installation You should clone this repository using: git clone https://github.com/Ma

68 Nov 09, 2022
Simple threaded Python Rickroll server. Listens on port 23 by default.

Terminal Rickroll Simple threaded Python Rickroll server. Listens on port 23 by default. Rickroll video made using Video-To-Ascii and the standard ric

AG 10 Sep 13, 2022
A Python package for handling free proxies from sslproxies.org

SSLProxies Get free working proxy from https://www.sslproxies.org/ and use it in your script This is a port/rewrite of free-proxy with additional feat

Nate Harris 2 Mar 17, 2022
A Python framework for interacting with Solana's Pyth network.

Pyth Network A basic Python framework for reading and decoding data regarding the Pyth network

1 Nov 29, 2021
syncio: asyncio, without await

syncio: asyncio, without await asyncio can look very intimidating to newcomers, because of the async/await syntax. Even experienced programmers can ge

David Brochart 10 Nov 21, 2022
Tool for pretty printing and optimizing Lightning Network channels.

Suez Tool for pretty printing and optimizing Lightning Network channels. Installation Install poetry poetry install poetry run ./suez Channel fee poli

Pavol Rusnak 69 Nov 03, 2022
AdaFruit Funhouse publishing Temperature, Humidity and Pressure to MQTT / Apache Pulsar

pulsar-adafruit-funhouse AdaFruit Funhouse publishing Temperature, Humidity and Pressure to MQTT / Apache Pulsar Device Get your own from adafruit Ada

Timothy Spann 1 Dec 30, 2021
Python implementation of the IPv8 layer provide authenticated communication with privacy

Python implementation of the IPv8 layer provide authenticated communication with privacy

203 Oct 26, 2022