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
云牧青
啥也不会
云牧青
forward several ports into a single port

port forwarding Multi-Input-Single-Output forward several ports into a single one this tool forwards packets from several ports into one single port.

Erfan Kheyrollahi Qaroğlu 3 Sep 11, 2021
Ping IP addresses and domains in parallel to find the accessible and inaccessible ones.

🚀 IPpy Parallel testing of IP addresses and domains in python. Reads IP addresses and domains from a CSV file and gives two lists of accessible and i

Shivam Mathur 54 May 21, 2022
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.

getme 1 Nov 10, 2021
Ping Verification Python Script

Python Script Port Scanner Script WHAT IS IT? Port scanner script using Python. HOW IT WORKS Once the script has been executed, it will request the ta

AC 0 Dec 12, 2021
A simple GitHub Action that physically puts your senses on alert when your build/release fails

GH Release Paniker A simple GitHub Action that physically puts your senses on alert when your build/release fails Usage Requirements: Raspberry Pi, LE

Hemanth Krishna 5 Dec 20, 2021
Geowifi 📡 💘 🌎 Search WiFi geolocation data by BSSID and SSID on different public databases.

Geowifi 📡 💘 🌎 Search WiFi geolocation data by BSSID and SSID on different public databases.

GOΠZO 441 Dec 23, 2022
Official ProtonVPN Linux app

ProtonVPN Linux App Copyright (c) 2021 Proton Technologies AG This repository holds the ProtonVPN Linux App. For licensing information see COPYING. Fo

ProtonVPN 288 Jan 01, 2023
nettrace is a powerful tool to trace network packet and diagnose network problem inside kernel.

nettrace nettrace is is a powerful tool to trace network packet and diagnose network problem inside kernel on TencentOS. It make use of eBPF and BCC.

84 Jan 01, 2023
A Python server and client app that tracks player session times and server status

MC Outpost A Python server and client application that tracks player session times and server status About MC Outpost provides a session graph and ser

Grant Scrits 0 Jul 23, 2021
No-dependency, single file NNTP server library for developing modern, rfc3977-compliant (bridge) NNTP servers.

nntpserver.py No-dependency, single file NNTP server library for developing modern, rfc3977-compliant (bridge) NNTP servers for python =3.7. Develope

Manos Pitsidianakis 44 Nov 14, 2022
A simple port scanner for Web/ip scanning Port 0/500 editable inside the .py file

Simple-Port-Scanner a simple port scanner for Web/ip scanning Port 0/500 editable inside the .py file Open Cmd/Terminal Cmd Downloads Run Command: pip

YABOI 1 Nov 22, 2021
This will generate a very basic DHCP config with use of PHPIPAM systems.

phpipam-dhcp-config-generator This will generate a very basic DHCP config with use of PHPIPAM systems. Requirements PHPIPAM Custom Fields domain_name

1 Oct 24, 2021
Initial code of an A3C network

A3C-network Initial code of an A3C network Open the python file named as "APL452 Project Report2" The following libraries and packages have been insta

Ayush Tanwar 0 Jun 11, 2022
Juniper SNMP Migrations For Python

Juniper SNMP Migrations This example will show how to use the PyEZ plugin for Nornir to build a NETCONF connection to a remote device validate that SN

Calvin Remsburg 1 Jan 07, 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
Solismod - A script subscribes to MQTT topics and waits for a message

SolisMod This is a first attempt to modify Solis inverter settings As SolisMon3,

9 Nov 14, 2022
Pteronode - Script for managing Pterodactyl nodes

pteronode Script for managing Pterodactyl nodes Pteronode allows you to create s

9 Sep 28, 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
Nautobot is a Network Source of Truth and Network Automation Platform.

Nautobot is a Network Source of Truth and Network Automation Platform. Nautobot was initially developed as a fork of NetBox (v2.10.4). Nautobot runs as a web application atop the Django Python framew

Nautobot 549 Dec 31, 2022
Utility for converting IP Fabric webhooks into a Teams format.

IP Fabric Webhook Integration for Microsoft Teams and/or Slack Setup IP Fabric Setup Go to Settings Webhooks Add webhook Provide a name URL will b

Community Fabric 1 Jan 26, 2022