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
云牧青
啥也不会
云牧青
This is a python based command line Network Scanner utility, which input as an argument for the exact IP address or the relative IP Address range you wish to do the Network Scan for and returns all the available IP addresses with their MAC addresses on your current Network.

This is a python based command line Network Scanner utility, which input as an argument for the exact IP address or the relative IP Address range you wish to do the Network Scan for and returns all t

Abhinandan Khurana 1 Feb 09, 2022
Enrich IP addresses with metadata and security IoC

Stratosphere IP enrich Get an IP address and enrich it with metadata and IoC You need API keys for VirusTotal and PassiveTotal (RiskIQ) How to use fro

Stratosphere IPS 10 Sep 25, 2022
Use Fast Redirect to easily redirect your domains.

Fast Redirect Use Fast Redirect to easily redirect your domains. Fast Redirects expects a JSON 'database'. This JSON 'database' contains the domains t

Cyberfusion 1 Dec 20, 2021
Equibles Stocks API for Python

Equibles Stocks API for Python Requirements. Python 2.7 and 3.4+ Installation & Usage pip install If the python package is hosted on Github, you can i

Equibles 3 Apr 15, 2022
Automatic Proxy scraper and Proxy-rotating Nitro Generator.

Automatic Proxy scraper and Proxy-rotating Nitro Generator.

Tawren007 2 Nov 08, 2021
API to establish connection between server and client

Socket-programming API to establish connection between server and client, socket.socket() creates a socket object that supports the context manager ty

Muziwandile Nkomo 1 Oct 30, 2021
An improved version of the original AutoDD

AutoDD = Automatically does the "due diligence" for you. If you want to know what stocks people are talking about on reddit, this little program might help you.

Steven Zhu 169 Oct 05, 2022
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
GNS3 Graphical Network Simulator

GNS3-gui GNS3 GUI repository.

GNS3 1.7k Dec 29, 2022
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
Tool written on Python that locate all up host on your subnet

HOSTSCAN Easy to use command line network host scanner. From noob to noobs. Dependencies Nmap 7.92 or superior Python 3.9 or superior All requirements

NexCreep 4 Feb 27, 2022
Flashes keyboard leds on incoming/outgoing network packets

LED Net Capture Flashes keyboard leds on incoming/outgoing network packets Usage Requires root priviledges to run usage: ledcapture.py [-h] --keyboard

Dan Habot 56 Oct 27, 2022
IP Rover - An Excellent OSINT tool to get information of any ip address

IP Rover - An Excellent OSINT tool to get information of any ip address. All details are explained in below screenshot

Saad 20 Dec 16, 2022
A Calendar subscribe server for python

cn-holiday-ics-server A calendar subscribe server 直接使用我搭建的服务 订阅节假日:https://cdxy.fun:9999/holiday 订阅调休上班:https://cdxy.fun:9999/workday 节假日和调休上班在一起的版本:h

CD 11 Nov 12, 2022
FIRM-AFL is the first high-throughput greybox fuzzer for IoT firmware.

FIRM-AFL is the first high-throughput greybox fuzzer for IoT firmware. FIRM-AFL addresses two fundamental problems in IoT fuzzing

356 Dec 23, 2022
track IP Address

ipX Table of Contents ipX Welcome Features Uses Author 📝 License Welcome find the location of an IP address. Specifically, you can get the following

Ali Shahid 15 Sep 26, 2022
Start a simple TCP Listener on a specified IP Address and Port Number and receive incoming connections.

About Start a simple TCP Listener on a specified IP Address and Port Number and receive incoming connections. Download Clone using git in terminal(git

AgentGeneric 5 Feb 24, 2022
A tiny end-to-end latency testing tool implemented by UDP protocol in Python 📈 .

udp-latency A tiny end-to-end latency testing tool implemented by UDP protocol in Python 📈 . Features Compare with other existing latency testing too

Chuanyu Xue 5 Dec 02, 2022
Securely and anonymously share files, host websites, and chat with friends using the Tor network

OnionShare OnionShare is an open source tool that lets you securely and anonymously share files, host websites, and chat with friends using the Tor ne

OnionShare 5.4k Jan 01, 2023
A Cheap Flight Alert program sends you a SMS to notify cheap flights in next 8 months.

Flight Dealer A Cheap Flight Alert program sends you a SMS to notify cheap flights (return trips) in next 6 months. Installing Download the Python 3 i

Aytaç Kaşoğlu 2 Feb 10, 2022