Automated Dynamic DNS Client
Table of Contents
- Introduction
- Supported Providers
- Configuration
- Custom DDNS Providers
- Build & Install
- Building from GIT
- Origin & References
Introduction
inadyn
you can register an Internet name with a DDNS provider, like FreeDNS. The DDNS client updates your DNS record periodically and/or on demand when your IP address changes. Inadyn can maintain multiple host records with the same IP address, use a combination of a script, the address from an Internet-facing interface, or default to using the IP address change detector of the DDNS provider.¹ Public IP address is the default, private addresses can also be used.
Supported Providers
- https://freedns.afraid.org
- https://nsupdate.info
- https://duckdns.org
- https://freemyip.com
- https://www.loopia.com
- https://www.dyndns.org, https://dyn.com
- https://www.zoneedit.com
- https://www.no-ip.com
- https://www.easydns.com
- https://www.dnsomatic.com
- https://dns.he.net
- https://www.tunnelbroker.net
- https://www.sitelutions.com
- https://www.dnsexit.com
- https://www.changeip.com
- https://www.dhis.org
- https://www.namecheap.com
- https://domains.google
- https://www.ovh.com
- https://www.dtdns.com
- https://giradns.com
- https://www.duiadns.net
- https://ddnss.de
- https://dynv6.com
- https://spdyn.de
- https://www.strato.com
- https://www.cloudxns.net
- https://www.dnspod.cn
- https://www.dynu.com
- https://www.selfhost.de
- https://connect.yandex.ru
- https://www.cloudflare.com
ssl = false
) or the checkip phase (checkip-ssl = false
) in the provider
section, in case you run into problems.Configuration
/etc/inadyn.conf
example show how this can be done. To verify your configuration, without starting the daemon, use:inadyn --check-config
.conf
file, to check any file, use:inadyn --check-config -f /path/to/file.conf
Example
# In-A-Dyn v2.0 configuration file format
period = 300
user-agent = Mozilla/5.0
# The FreeDNS username must be in lower case
# The password (max 16 chars) is case sensitive
provider freedns {
username = lower-case-username
password = case-sensitive-pwd
hostname = some.example.com
}
provider freemyip {
password = YOUR_TOKEN
hostname = YOUR_DOMAIN.freemyip.com
}
provider dyn {
ssl = false
username = charlie
password = snoopy
hostname = { peanuts, woodstock }
user-agent = Mozilla/4.0
}
# With multiple usernames at the same provider, index with :#
provider no-ip.com:1 {
username = ian
password = secret
hostname = flemming.no-ip.com
user-agent = inadyn/2.2
}
# With multiple usernames at the same provider, index with :#
provider no-ip.com:2 {
username = james
password = bond
hostname = spectre.no-ip.com
checkip-ssl = false
checkip-server = api.ipify.org
}
# With multiple usernames at the same provider, index with :#
provider no-ip.com:3 {
username = spaceman
password = bowie
hostname = spaceman.no-ip.com
checkip-command = "/sbin/ifconfig eth0 | grep 'inet6 addr'"
}
# Note: hostname == update-key from Advanced tab in the Web UI
provider tunnelbroker.net {
username = futurekid
password = dreoadsad/+dsad21321 # update-key-in-advanced-tab
hostname = 1234534245321 # tunnel-id
}
provider dynv6.com {
username = your_token
password = n/a
hostname = { host1.dynv6.net, host2.dynv6.net }
}
provider cloudxns.net {
username = your_api_key
password = your_secret_key
hostname = yourhost.example.com
}
provider dnspod.cn {
username = your_api_id
password = your_api_token
hostname = yourhost.example.com
}
provider cloudflare.com {
username = your_email
password = your_api_token
hostname = yourhost.example.com
}
:ID
to the provider name./var/cache
. In our case /mnt
is a system specific persistent store for caching your IP address as reported to each provider. Inadyn use this to ensure you are not locked out of your account for excessive updates, which may happen if your device Internet gateway running inadyn gets stuck in a reboot loop, or similar.--startup-delay=SEC
. To tell inadyn
it is OK to proceed before the SEC
timeout, use SIGUSR2
.hostname
is set to the tunnel ID and password must be the Update key found in the Advanced configuration tab.checkip-server
for a DDNS provider can be very slow to respond, to this end Inadyn now supports overriding this server with a custom one, like for custom DDNS provider, or even a custom command. See the man pages, or the below section, for more information.user-agent = STRING
setting, as shown above. It is available both on a global and on a per-provider level..conf
to 600 (read-write only by you/root) to protect against other users reading your DDNS server credentials.Custom DDNS Providers
custom {}
in instead of the provider {}
section used in examples above.custom twoDNS {
username = myuser
password = mypass
checkip-server = checkip.two-dns.de
checkip-path = /
ddns-server = update.twodns.de
ddns-path = "/update?hostname="
hostname = myhostname.dd-dns.de
}
custom namecheap {
username = myuser
password = mypass
ddns-server = dynamicdns.park-your-domain.com
ddns-path = "/update?domain=YOURDOMAIN.TLD&password=mypass&host="
hostname = { "alpha", "beta", "gamma" }
}
ddns-path
, as is customary, before it is communicated to the server. Username is your Namecheap username, and password would be the one given to you in the Dynamic DNS panel from Namecheap. Here is an alternative config to illustrate how the hostname
setting works:custom kruskakli {
username = myuser
password = mypass
ddns-server = dynamicdns.park-your-domain.com
ddns-path = "/update?password=mypass&domain="
hostname = YOURDOMAIN.TLD
}
ddns-path
differs between providers and is something you must figure out. The support pages sometimes list this under an API section, or similar.# This emulates dyndns.org
custom dyn {
username = DYNUSERNAME
password = DYNPASSWORD
ddns-server = members.dyndns.org
ddns-path = "/nic/update?hostname=%h.dyndns.org&myip=%i"
hostname = { YOURHOST, alias }
}
ddns-path
with format specifiers are used, see the inadyn.conf(5)
man page for details on this.200 HTTP
response OK code and the strings "good"
, "OK"
, "true"
, or "updated"
in the HTTP response body. If the DDNS provider returns something else you can add a list of possible ddns-response = { Arrr, kilroy }
, or just a single ddns-response = Cool
-- if your provider does give any response then use ddns-response = ""
.checkip-server
, you can use other free services, like http://ipify.orgcheckip-server = api.ipify.org
checkip-command = /sbin/ifconfig eth0 | grep 'inet addr'
provider{}
sections.hostname
is required, even if everything is encoded in the ddns-path
! The given hostname is appended to the ddns-path
used for updates, unless you use append-myip
in which case your IP address will be appended instead. When using append-myip
you probably need to encode your DNS hostname in the ddns-path
instead, as is done in the last example above.Build & Install
Homebrew (macOS)
brew install inadyn
brew install --HEAD troglobit/inadyn/inadyn
Building from Source
pkg-config
tool:- libConfuse (3.0+)
- LibreSSL, OpenSSL, or GnuTLS
-dev
or -devel
package of the distribution packages when building Inadyn. On Debian/Ubuntu (derivatives):$ sudo apt install gnutls-dev libconfuse-dev
pkg-config
tool, and make:$ sudo apt install build-essential pkg-config
ca-certificates
package on your system, otherwise Inadyn will not be able to validate the DDNS provider's HTTPS certificates.Configure & Build
/usr/local
as the default install prefix. In many cases this is useful, but this means the configuration files and cache files will also use that same prefix. Most users have come to expect those files in /etc/
and /var/run/
and configure has a few useful options that are recommended to use:$ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
$ make -j5
$ sudo make install-strip
--prefix=/usr
option.SSL/TLS Support
./configure --enable-openssl
./configure --disable-ssl
- https://lists.debian.org/debian-legal/2004/05/msg00595.html
- https://people.gnome.org/~markmc/openssl-and-the-gpl
RedHat, Fedora, CentOS
/usr/local
, is disabled and not searched by tools like ldconfig
and pkg-config
. So if configure fails to find the libConfuse libraries, or the .pc
files, create the file /etc/ld.so.conf.d/local.conf
with this content:/usr/local/lib
sudo ldconfig -v |egrep libconfuse
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure
Integration with systemd
pkg-config
, which helps the Inadyn build system figure out the systemd paths. When installed simply call systemctl
to enable and start inadyn
:$ sudo systemctl enable inadyn.service
$ sudo systemctl start inadyn.service
$ sudo systemctl status inadyn.service
Building from GIT
configure.ac
and a per-directoryMakefile.am
are key filesconfigure
andMakefile.in
are generated fromautogen.sh
, they are not stored in GIT but automatically generated for the release tarballsMakefile
is generated byconfigure
script
autogen.sh
script. This requires the GNU tools automake
, autoconf
and libtool
to be installed on your system. Released tarballs do not require these tools.$ sudo apt install git automake autoconf
configure
script, which is not part of the GIT repo:git clone https://github.com/troglobit/inadyn.git
cd inadyn/
./autogen.sh
./configure && make
Building with Docker
inadyn
.docker build -t inadyn:latest .
docker run --rm -v "$PWD/inadyn.conf:/etc/inadyn.conf" inadyn:latest
Origin & References
dnspod.py
@author migege
@version 0.0.2
Prerequisites
- python
- pyyaml
- requests
pip install
命令安装。如果未安装 pip,请先安装 pip。Installation
git clone https://github.com/migege/dnspod.git dnspod
conf.yaml
文件,根据您的 DNSPod 设置,填入以下内容:token:sub_domains: : domain_id: record_id: : domain_id: record_id:
*/10 * * * * cd; /usr/bin/python dnspod.py conf.yaml > /dev/null 2>&1 &
Tips
- */10 表示每 10 分钟执行一次 dnspod.py
- 如果 python 可执行路径不是 /usr/bin/python,请自行替换
基于dnspod api构架的bash ddns客户端,实现DDNS功能(动态域名解析) 这个脚本是我在dnspod的页面上找到的, 我在原脚本的基础上加上了两个小功能 1.支持token登录。DNSPOD官方推荐的方法,避免在脚本中直接使用账户和密码。 2.支持从本地获取ip地址。因为我的宽带商使用了缓存服务器,所以从网上获取ip地址的话得到的是只是缓存服务器的地址,所以只能从本地获取ip。 ##该脚本只支持bash 我在自己的路由器(优酷路由宝,pandorabox)里执行时发现脚本会报错。 找了好久才发现是因为pandorabox自带的是ash,所以自己安装了一个bash shell,才解决报错的问题。 这个脚本原作者是zrong(zengrong.net),他写了一篇不错的文档来介绍脚本的使用方法,地址是:http://zengrong.net/post/1524.htm
from https://github.com/niushuai1991/dnspodsh
------
dnspod-ddns is a ddns updating tool of dnspod。
dnspod-ddns
Download
You can install using Node Package Manager (npm):npm install -g dnspod-ddnsUsage
dnspod-ddns is a command line tool. It will update your dns record after you execute the following. You can add it to crontab for continuously updating.dnspod-ddns --dns-domain yourdomain.com --dns-host yourhost --user youremail --passwd yourpasswordOR using login_tokendnspod-ddns --dns-domain yourdomain.com --dns-host yourhost --login-token yourtokenOtherwise, you can run it in daemon mode.dnspod-ddns --dns-domain yourdomain.com --dns-host yourhost --user youremail --passwd yourpassword --daemonOR using login_tokendnspod-ddns --dns-domain yourdomain.com --dns-host yourhost --login-token yourtoken --daemonIn some cases, you may want to resolve the name with your local IP instead of public IP. Just use--interface
or-i
to specify a network interface.dnspod-ddns --dns-domain yourdomain.com --dns-host yourhost --user youremail --passwd yourpassword --interface eth0OR using login_tokendnspod-ddns --dns-domain yourdomain.com --dns-host yourhost --login-token --interface eth0from https://github.com/ohsc/dnspod-ddns------The Dnspod DDNS with BashShell。
Dnspod-DDNS-with-BashShell
利用Dnspod的API和shell脚本搭建自己的动态域名服务。按照本脚本的逻辑理论上和实测正常使用不可能超过限制,请放心使用!)使用方法
本脚本分为两个版本,一个是获取自己外网ip的版本dnspod_ddns.sh,一个是直接获取自己网卡设备上的ip的版本dnspod_ddns_line.sh(对于多拨或者路由器网关用户适用)。获取API的ID和Token
API的ID和Token可以在后台获取:dnspod_ddns.sh
参数说明
在脚本开头#CONF START到#CONF END之间为用户所需填写的参数:
参数 填写说明 API_ID 在个人中心后台的安全设置里面获取ID API_Token 在个人中心后台的安全设置里面获取Token domain 你所注册的主域名,例如 baidu.com
,qq.com
,china.edu.cn
,example.com
host 主机记录名,例如 www.baidu.com
的主机记录名是www
,image.www.weibo.com
的主机记录是image.www
,home.example.com
的主机记录名是home
CHECKURL 用于检查自己的外网IP是什么的网址,注释掉该参数会跳过本地DNS检查比对,直接执行(验证域名记录是否存在以及记录是否重复后)更新;建议的备选CHECKURL: http://ip.03k.org
http://ip.3322.org
http://myip.ipip.net
http://checkip.dns.he.net/
https://api-ipv4.ip.sb/ip
OUT 指定使用某个网卡设备进行联网通信(默认被注释掉)。注意,一些系统的负载均衡功能可能会导致该参数无效。推荐使用 ip a
命令或者ifconfig
命令查看网卡设备名称。推荐的部署方法
把如上所述的参数填好即可。 本脚本没有自带循环,因为linux平台几乎都有Crontab(计划任务),利用计划任务可以实现开机启动、循环执行脚本、并设定循环频率而无需常驻后台。命令参考 假设脚本已经填写好参数并加了可执行权限(chmod +x ./dnspod_ddns.sh
),并位于/root/dnspod_ddns.sh
: 新建计划任务输入crontab -e
按a进入编辑模式,输入*/1 * * * * /root/dnspod_ddns.sh &> /dev/null
意思是每隔一分钟执行/root/dnspod_ddns.sh并屏蔽输出日志。当然,如果你需要记录日志可以直接重定向至保存路径。 然后按Esc,输入:wq回车保存退出即可。 更多关于Crontab的使用方法此处不再详述。 另外对于一些带有Web管理界面嵌入式系统(比如openwrt),有图形化的计划任务菜单管理,可以直接把脚本粘贴进去。工作过程
1、用CHECKURL检查自己的外网ip和本地解析记录是否相同,相同则退出; 2、使用API获取域名在Dnspod平台的ip记录,如果CHECKURL(line.sh则是直接获取网卡ip)获取IP结果和“本地DNS解析记录或者API记录”相同则退出;获取记录异常也会退出并返回错误信息(例如域名不存在No Record); 3、执行DNS更新,并返回执行结果。注意事项
本脚本不会自动创建子域名,请务必先到后台添加一个随意的子域名A记录,否则会提示No Record 如果你看到API usage is limited的报错,是由于调用API频率过高账号被冻结(一小时后解封)dnspod_ddns_line.sh
仅说明与上面脚本参数不同的地方。 因该脚本是用于获取网卡设备ip,所以没有CHECKURL参数。参数说明
参数 填写说明 DEV 从网卡设备(例如eht0)上获取ip,并与DNS记录比对更新。推荐使用 ip a
命令ifconfig
命令查看网卡设备名称。日志参考
现象 说明 [DNS IP]为Get Domain Failed 本地DNS解析出现问题(断网、DNS服务器不工作、域名记录错误) [URL IP]为空 访问CHECKURL失败,检查网络访问CHECKURL是否正常 No Record 不存在该域名或者该主机记录(本脚本不会自动创建子域名,请务必先到后台添加一个随意的子域名A记录) API usage is limited 调用API频率过高账号被冻结(一小时后解封),正常使用一般不会出现 [URL IP]或者[DEV IP] 和[DNS IP]不一样但和[API IP]一样 DNS有缓存,DNS记录是已经更新,属正常现象,会提示IP SAME IN API,SKIP UPDATE.自动忽略 关于
https://03k.org/dnspod-ddns-with-bashshell.html-------定时检查ip变化并更新dnspod的解析记录.dnspod-ddns
定时检查 ip 变化并更新dnspod的解析记录.程序运行在python 3.5以上.推荐使用: https://napyy.com开始使用
本地运行
在 Linux 下,配置文件路径:/etc/dnspod/ddnsrc
(也可通过环境变量设置)在 Windows 下,配置文件路径为本目录下的:ddnspod.cfg
可配置的有效参数如下:LOGIN_TOKEN=token_id,token DOMAIN=domain.com SUB_DOMAIN=www INTERVAL=5 EMAIL=you@email.com IP_COUNT=1
- LOGIN_TOKEN : 必填, 在dnspod上申请的api组成的token,参考:https://support.dnspod.cn/Kb/showarticle/tsid/227/
- DOMAIN : 必填, 在dnspod解析的域名
- SUB_DOMAIN : 必填, 使用ddns的子域名
- INTERVAL: 选填, 轮询检查的时间间隔, 单位秒, 默认为5, 建议不要小于5
- EMAIL: 选填, 你的邮箱
- IP_COUNT: 选填, 你服务器的出口IP数量,一般为1,填大了一般也没事(玩 OpenWrt 的可能会有多个IP)
运行python ddns.py
Docker
和本地运行类似,需要配置参数.参数的具体含义请参考本地运行.通过挂载配置文件方式:docker run -d \ --restart=always \ --name=dnspod-ddns \ -v your_ddnsrc_file_path:/etc/dnspod/ddnsrc \ strahe/dnspod-ddns通过传递环境变量的方式:docker run -d \ --restart=always \ --name=dnspod-ddns \ -e "login_token=token_id,token" \ -e "domain=domain.com" \ -e "sub_domain=www" \ -e "interval=10" \ -e "email=your@email.com" \ -e "ip_count=1" \ strahe/dnspod-ddns测试环境
以下为测试通过的环境:
- Windows 10
- Windows Server 2016
- Debian 4.9.8
尚未测试,应该能适配的环境:
- Centos
- Ubuntu
------说明 该脚本使用python
编写,利用dnspod api
开发的一个ddns。 ##字段说明public_dic["login_email"]
这个是你在dnspod.cn上的账号public_dic["login_password"]
这个是你在dnspod.cn上的密码domain
需要操作的域名,例如 baidu.com 、lixin.me 、lixin.inforecord
需要解析的记录,例如 wwwisCron
如果脚本由一个定时触发的任务执行的话,值为True
,否则脚本将在循环不会停止#使用方法 ##1 不需要提供参数执行脚本 首先打开文件,为public_dic["login_email"]
、public_dic["login_password"]
、domain
、record
这4个参数填写对应的数据。 以后只需要执行python LixinDDNS.py
即可 ##2不修改文件带参数执行 需要向脚本提供4个参数,分别是dnsp登陆账号,密码,操作的域名,和操作的记录python LixinDDNS.py
##3通过读取配置文件执行 其中`option` 作为配置文件的节点保存在文件`ddns.cfg`中,这样就可以同时使用管理多个域名记录。python LixinDDNS.py
##使用注意 record记录,一般就是你的二级域名记录,应该事先存在,如果你在dnspod上并没有xxx.domain.com 这个xxx记录是不行的。 使用该脚本,你的dnspod不能开启D令牌。------https://github.com/birkett/CloudFlare-DDNS-Updater
--------
A tool to update freenom's dns records.
Freenom dns updater
A tool written in python to update freenom's dns recordsMain Features
- Manage (add/update/remove) a domain's dns record with cli
- Automatic records updates according to ip (v4/v6) changes
Upcoming features
- Auto renew domains
Installation
pip install freenom-dns-updaterUsage
Basic usage
Let's say you want to add or update your main A/AAAA domain records exemple.tk with your current ip (v4/v6). Simply type :fdu record update $LOGIN $PASSWORD exemple.tk
Note that if you don't have a ipv6 access, the tool will detect that and will update only the A record (ipv4) of exemple.tk.In order to add or update the subdomain sub.exemple.tk:fdu record update $LOGIN $PASSWORD exemple.tk -n sub
Advanced usage
If you want to update multiple (sub)domains you could call the tool for each domains. Even better, you can create a configuration file. A configuration is a YAML file, which look like :login: yourlogin@somemail.domain password: yourpassword # list here the records you want to add/update record: # the following will update both the A and AAAA records with your current ips (v4 and v6). # Note that if you don't have a ipv6 connection, the program'll detect it and will only update the A record (ipv4) - domain: test.tk # the following will update both your subdomain's A and AAAA records with your current ips (v4 and v6) - domain: test.tk name: mysubdomain # here's more advanced exemples # the following will update the AAAA record with a specified ipv6 - domain: test2.tk name: # you can omit this line type: AAAA target: "fd2b:1c1b:3641:1cd8::" # note that you have to quote ipv6 addresses ttl: 24440 # the following will update your subdomain's A record with your current ip (v4) - domain: test2.tk name: mysubdomain type: A target: auto # you can omit this line # you can omit the record type and give only ipv4 or ipv6 addresses. - domain: test2.tk name: ipv6sub target: "fd2b:1c1b:3641:1cd8::" - domain: test2.tk name: ipv4sub target: "64.64.64.64"In order to use such configuration, you can use the following command :fdu update /path/to/configWhere /path/to/config can be either:
- A path to a file (default location is
/etc/freenom.yml
)- A http url (a raw secret gist for instance)
Schedule
In order to launch regularly an update, you can launch the tool with :fdu process -c -i -t 3600 /path/to/configWhere the params are :
param description -c cache the ip and update only if there is any changes -i ignore errors when updating -t time (in second) to wait between two updates /path/to/config a path or a url to a configuration file Using systemd
For ease of use a systemd unit file is available along the source code.
- Save your configuration into
/etc/freenom.yml
- Copy the
systemd/system/freenom-dns-updater.service
into a valid systemd unit folder (/usr/lib/systemd/system/
for instance).- finally enable the service using
systemctl enable freenom-dns-updater systemctl start freenom-dns-updater
Using other Os / services manager
There's two straightforward choices :
- Launch the previous
fdu process
command- Schedule the
fdu update
command using cron, windows' scheduled task, ...Known issues
- The domain my.freenom.com has SSL Chain issues. For now this tool use a custom
chain.pem
to avoid ssl errors.Docker image
If you want to run this tool in an isolated environment there's a docker image available at maxisoft/freenom-dns-updaterIpv6
Note that if you want to use the ipv6 functionality, you have to enable the docker ipv6 stackExamples
- Update dns records using a gist config file :
docker run -it --rm maxisoft/freenom-dns-updater-armhf fdu update https://gist.githubusercontent.com/maxisoft/1b979b64e4cf5157d58d/raw/freenom.yml
- Run the tool in a background docker with a local config file :
docker run -d --rm -v /path/to/config:/etc/freenom.yml maxisoft/freenom-dns-updater-armhfFor armhf
There's also an image for armhf (raspberry pi for instance) available at maxisoft/freenom-dns-updater-armhf------Simple, free dynamic DNS via Cloudflarecloudflare-ddns
A dynamic DNS script (written in PHP) that uses CloudFlare's free DNS and their API to set up a dynamic DNS record pointing to your server.How To Use
git clone https://github.com/lyoshenka/cloudflare-ddns.git cd cloudflare-ddns cp config.php.skel config.php ### Edit config.php - enter your CloudFlare credentials and domain details ./ddns.php
If everything works, put it in your crontab.0 * * * * /path/to/cloudflare-ddns/ddns.php -s
Extra feature: API mode
If you want, you can put this script on a web server and use the "dynamic DNS" option of your router to trigger the IP update.To do this, first enable API mode by setting anauth_token
value in your config.Then, configure your router to call the script like this:https://example.com/ddns.php?auth_token=YOUR_TOKEN&ip=IP_ADDR
-------a Python tool to dynamic update DNS record at DNSPodIntroduction
dnspod_ddns a Python tool to dynamic update DNS record at DNSPod.Installing
Clone the repo withgit
and install the requirements withpip
:$ git clone https://github.com/leeyiw/dnspod_ddns.git $ cd dnspod_ddns $ sudo pip install -r requirements.txt
Then editconfig.py
, replace the value ofLOGIN_EMAIL
,LOGIN_PASSWORD
,SUB_DOMAIN
,DOMAIN
with your DNSPod account and the domain you want to dynamic update.Usage
Command line options are:Usage: dnspod_ddns.py [options] Options: -h --help Show this screen. -t TIME Check IP change every TIME seconds [default: 60]. -d ACTION Run this script as a daemon (e.g. start,stop,restart). -l LOG_PATH Program log file [default: /var/log/dnspod_ddns.log]. -p PID_FILE Use PID_FILE as daemon's pid file [default: /var/run/dnspod_ddns.pid].
You can run this script as a daemon with command:sudo python dnspod_ddns.py -d start
Or run it in foreground mode with the following command (-l
and-p
options will be ignored, and log will output to console):python dnspod_ddns.py
from https://github.com/leeyiw/dnspod_ddns-------A dynamic DNS client tool, supports AliDNS, Cloudflare, Google Domains, DNSPod & HE.net, written in Go.https://xiaozhou.net/godns-project-20…GoDNS is a dynamic DNS (DDNS) client tool, it is based on my early open source project: DynDNS.Supported DNS Provider
- Cloudflare (https://cloudflare.com)
- Google Domains (https://domains.google)
- DNSPod (https://www.dnspod.cn/)
- HE.net (Hurricane Electric) (https://dns.he.net/)
- AliDNS (https://help.aliyun.com/product/29697.html)
Supported Platforms
- Linux
- MacOS
- ARM Linux (Raspberry Pi, etc...)
- Windows
- MIPS32 platform
MIPS32 platform
To compile binaries for MIPS (mips or mipsle):GOOS=linux GOARCH=mips/mipsle GOMIPS=softfloat go build -aAnd the binary can run well on routers.Pre-condition
Register and own a domain.Get it
Build it from source code
- Get source code from Github:
git clone https://github.com/timothyye/godns.git
- Go into the godns directory, get related library and then build it:
cd cmd/godns go get -v go build
Download from releases
Download compiled binaries from releasesGet help
$ ./godns -h Usage of ./godns: -c string Specify a config file (default "./config.json") -h Show helpConfig it
- Get config_sample.json from Github.
- Rename it to config.json.
- Configure your provider, domain/subdomain info, username and password, etc.
- Configure the SMTP options if you want, a mail notification will sent to your mailbox once the IP is changed.
- Save it in the same directory of GoDNS, or use -c=your_conf_path command.
Config fields
- provider: The providers that GoDNS supports, available values are:
Cloudflare
,DNSPod
,AliDNS
,HE
.- email: Email or account name of your DNS provider.
- password: Password of your account.
- login_token: Login token of your account.
- domains: Domains list, with your sub domains.
- ip_url: A site helps you to get your public IP address.
- interval: The interval
seconds
that GoDNS check your public IP.- socks5_proxy: Socks5 proxy server.
Config example for Cloudflare
For Cloudflare, you need to provide email & Global API Key as password, and config all the domains & subdomains.{ "provider": "Cloudflare", "email": "you@example.com", "password": "Global API Key", "domains": [{ "domain_name": "example.com", "sub_domains": ["www","test"] },{ "domain_name": "example2.com", "sub_domains": ["www","test"] } ], "ip_url": "https://myip.biturl.top", "interval": 300, "socks5_proxy": "" }Config example for DNSPod
For DNSPod, you need to provide your API Token(you can create it here), and config all the domains & subdomains.{ "provider": "DNSPod", "login_token": "your_id,your_token", "domains": [{ "domain_name": "example.com", "sub_domains": ["www","test"] },{ "domain_name": "example2.com", "sub_domains": ["www","test"] } ], "ip_url": "https://myip.biturl.top", "interval": 300, "socks5_proxy": "" }Config example for Google Domains
For Google Domains, you need to provide email & password, and config all the domains & subdomains.{ "provider": "Google", "email": "Your_Username", "password": "Your_Password", "domains": [{ "domain_name": "example.com", "sub_domains": ["www","test"] },{ "domain_name": "example2.com", "sub_domains": ["www","test"] } ], "ip_url": "https://myip.biturl.top", "interval": 300, "socks5_proxy": "" }Config example for AliDNS
For AliDNS, you need to provideAccessKeyID
&AccessKeySecret
aspassword
, and config all the domains & subdomains.{ "provider": "AliDNS", "email": "AccessKeyID", "password": "AccessKeySecret", "login_token": "", "domains": [{ "domain_name": "example.com", "sub_domains": ["www","test"] },{ "domain_name": "example2.com", "sub_domains": ["www","test"] } ], "ip_url": "https://myip.biturl.top", "interval": 300, "socks5_proxy": "" }Config example for HE.net
For HE, email is not needed, just fill DDNS key to password, and config all the domains & subdomains.{ "provider": "HE", "password": "YourPassword", "login_token": "", "domains": [{ "domain_name": "example.com", "sub_domains": ["www","test"] },{ "domain_name": "example2.com", "sub_domains": ["www","test"] } ], "ip_url": "https://myip.biturl.top", "interval": 300, "socks5_proxy": "" }HE.net DDNS configuration
Add a new "A record", make sure that "Enable entry for dynamic dns" is checked:Fill your own DDNS key or generate a random DDNS key for this new created "A record":Remember the DDNS key and fill it as password to the config.json.NOTICE: If you have multiple domains or subdomains, make sure their DDNS key are the same.Get an IP address from the interface
For some reasons if you want to get an IP directly from the interface, sayeth0
for Linux orLocal Area Connection
for Windows, update config file like this:"ip_url": "", "ip_interface": "eth0",If you set bothip_url
andip_interface
, it first tries to get an IP address online, and if not succeed, gets an IP address from the interface as a fallback.Note that IPv6 address will be ignored currently.Email notification support
Update config file and provide your SMTP options, a notification mail will be sent to your mailbox once the IP is changed and updated."notify": { "enabled": true, "smtp_server": "smtp.example.com", "smtp_username": "user", "smtp_password": "password", "smtp_port": 25, "send_to": "my_mail@example.com" }Notification mail example:SOCKS5 proxy support
You can also use SOCKS5 proxy, just fill SOCKS5 address to thesocks5_proxy
item:"socks5_proxy": "127.0.0.1:7070"Now all the queries will go through the specified SOCKS5 proxy.Run it as a daemon manually
nohup ./godns &
Run it as a daemon, manage it via Upstart
- Install
upstart
first- Copy
./upstart/godns.conf
to/etc/init
- Start it as a system service:
sudo start godnsRun it as a daemon, manage it via Systemd
- Modify
./systemd/godns.service
and config it.- Copy
./systemd/godns.service
to/lib/systemd/system
- Start it as a systemd service:
sudo systemctl enable godns sudo systemctl start godns
Run it with docker
Now godns supports to run in docker.
- Get config_sample.json from Github.
- Rename it to config.json.
- Run GoDNS with docker:
docker run -d --name godns --restart=always \ -v /path/to/config.json:/usr/local/godns/config.json timothyye/godns:latestRun it as a Windows service
- Get birkett/srvany-ng from Github.
- Uncompress and place the executable
srvany-ng.exe
to the same directory wheregodns.exe
in.- Create a service and add registry keys according to the guide here.
Enjoy it!
-----ddserver - A dynamic DNS service
About
ddserver is a server-side application for dynamic DNS.It allows you to specify hostnames (subdomains) inside a dynamic DNS zone, and to update the IPv4 address of those hostnames using the dyndns2 update protocol (http://www.noip.com/integrate). This enables you to access hosts with dynamic IP addresses by a static domain name, even if the IP address changes.Features
- Nice and intuitive Web-UI
- Automatic / Semi-automatic registration or manual user management
- Administrators can add and manage zones
- Users can add and manage hostnames
- Re-captcha support
- IP-address update using the dyndns2 protocol
- Update multiple hostnames at once
- Works with most homerouters, ddclient or even wget
- Manual IP-address updates via Web-UI
- Support for multiple domains
- Configurable number of hosts per user
- Strong encryption of all passwords (host and user)
- Supports distributed installation
- Separate packages for Web-UI, updater and DNS-backend
- Redundancy support
Mode of operation
ddserver is written in Python (2.7) using the Bottle Web Framework and comes with a clean HTML5 frontend using the Bootstrap3 CSS framework.All user and hostname information is stored in a MySQL database. For name resolution ddserver depends on PowerDNS as the DNS server.The individual parts of ddserver, which may run on one server, or distributed on different machines, are
- ddserver-bundle is the bundled version of
- ddserver-interface: A nice-looking webinterface for adding hostnames or zones and managing users.
- ddserver-updater: The implementation of the dyndns2 update protocol.
- ddserver-recursor answers DNS queries. It runs as a pipe-backend for the PowerDNS server.
from https://github.com/ddserver/ddserver
-----
Introduction: DynDNS is a ruby script which uses DNSPod(http://www.dnspod.cn) to implement DDNS(Dynamic DNS).For more powerful DDNS tool, please visit https://github.com/TimothyYe/godnsAuthor: TimothyContributor: Jason (https://github.com/outmanone)**Created Date:**2012.04.19##How To UsePrepare your Ruby runtime first.
Step 1: git clone git://github.com/TimothyYe/DynDNS.git Step 2: Edit "Config.yml", fill your domain information & DNSPod username & password. Step 3: ruby DynDNS.rb startfrom https://github.com/TimothyYe/DynDNS
-----
Self-hosted dyndns/dynamic DNS server.
sftdyn dynamic dns server
sftdyn
is a minimalistic dynamic DNS server that accepts update requests via HTTP(S) and forwards them to a locally running DNS server viansupdate -l
.It lets you easily create a dyndns.org-like service, using your own DNS server, and can (probably) be used with your router.Operation
- Some device submits a https request to a "secret URL" of
sftdyn
- From this,
sftdyn
knows the request origin IP- From the "secret URL",
sftdyn
updates the DNS record of the associated hostname- The request therfore updated an IP in your zone
Requirements
Quick Guide
sftdyn
is for you if you host a DNS zone and can run a Python server so it updates the nameserver records. This guide assumes that you're using bind, your zone isdyn.sft.mx
, and your server's IP is12.345.678.90
. Substitute the correct values for zone and IP as you use this guide.Nameserver
bind
has to be configured to serve the updatable zone.Somewhere innamed.conf
, addzone "dyn.sft.mx" IN { type master; file "/etc/bind/dyn.sft.mx.zone"; journal "/var/cache/bind/dyn.sft.mx.zone.jnl"; update-policy local; };
/var/cache/bind
must be writable for bind.Create the empty zone filecp /etc/bind/db.empty /etc/bind/dyn.sft.mx.zone
If you want to usedyn.sft.mx
as the hostname for your update requests, add a record to the zone file:@ IN A 12.345.678.90 @ IN AAAA some:ipv6::address
sftdyn
To install sftdyn, usepip install sftdyn
or./setup.py install
.Launch it withpython3 -m sftdyn [command-line options]
.Configuration is by command-line parameters and conf file. A sample conf file is provided inetc/sample.conf
. If no conf file name is provided,/etc/sftdyn/conf
is used. Hostnames/update keys are specified in the conf file.systemd service
To runsftdyn
automatically, you can use a systemd service.Thesftdyn
distribution package should automatically installsftdyn.service
.If you have to manually install it, use the example unitetc/sftdyn.service
and copy it to/etc/systemd/system/sftdyn.service
on thesftdyn
host machine.Enable the launch on boot and also startsftdyn
now:sudo systemctl enable --now sftdyn.service
Unencrypted operation
You can usesftdyn
in plain HTTP mode. Your average commercial dynamic DNS provider provides a HTTP interface, so most routers only support that.Somebody could grab your "secret url" with this and perform unintended updates of your record.Encrypted operation
Because of the above reason, you should use HTTPS to keep your update url token secret. For that, your server needs a X.509 key and certificate. You can create those with let's encrypt, buy those somewhere, or create a self-signed one.Self-signed certificate
To generateserver.key
and a self-signedserver.crt
valid for 1337 days:openssl genrsa -out server.key 4096 openssl req -new -key server.key -out server.csr openssl x509 -req -days 1337 -in server.csr -signkey server.key -out server.crt rm server.csr
Make sure you enter your server's domain name for Common Name.sftdyn
should run under the same user as your DNS server, or it might not be able to update it properly.Client
The client triggers the IP update at thesftdyn
server, so your DNS then delivers the correct IP.Plastic router
To use your router as client, select user-defined provider, enter http://dyn.sft.mx:8080/yourupdatekey as the update URL, and random stuff as domain name/user name/password. (tested with my AVM Fritz!Box. YMMV). Most routers don't support HTTPS update requests (especially not with custom CA-cert, so you'll probably need HTTP.Request with
curl
If you want to update the external IP of some network, and a machine in that network can usecurl
, choose this client method.If you use HTTPS with a self-signed certificate,curl
will refuse to talk to the server.
- Use
curl -k
to ignore the error (Warning: see the security considerations below).- Copy
server.crt
to the client, and usecurl --cacert server.crt
.
HTTP code Text Response interpretation 200 OK Update successful 200 UPTODATE Update unneccesary 403 BADKEY Unknown update key 500 FAIL Internal error (see the server log) 200 your ip Returned if no key is provided systemd timer
systemd
timers are like cronjobs. Use them to periodically run the update query.Create/etc/systemd/system/sftdynupdate.timer
:[Unit] Description=SFTdyn dns updater [Timer] OnCalendar=*:0/15 Persistent=true [Install] WantedBy=timers.target
Create/etc/systemd/system/sftdynupdate.service
:[Unit] Description=SFTdyn name update [Service] Type=oneshot User=nobody ExecStart=/usr/bin/env curl -f -s --cacert /path/to/server.crt https://dyn.sft.mx:4443/yoursecretupdatekey
Activate the timer firing with:sudo systemctl enable --now sftdyn.timer
Verify the timer is scheduled:sudo systemctl list-timers
To manually trigger the update (e.g. for testing purposes):sudo systemctl start sftdyn.service
Cronjob
Cronjobs are the legacy variant to periodically run a task, you could do this like this:*/10 * * * * curl https://dyn.sft.mx:4443/mysecretupdatekey
About
This software was written after the freedyndns.org
service was shut down. After a week or so of using plainnsupdate
, I was annoyed enough to decide to write this.It is the main goal to stay as minimal as possible; for example, I deliberately didn't implement a way to specify the hostname or IP that you want to update; just a simple secret update key is perfectly good for the intended purpose. If you feel like it, you can make the update key look like a more complex request; every character is allowed. Example:?host=test.sft.mx&key=90bbd8698198ea76
.The conf file is interpreted as python code, so you can do arbitrarily complex stuff there.Security considerations
- When using HTTP, or if your
server.key
has been stolen or broken, an eavesdropper can steal your update key, and use that to steal your domain name.- When using HTTPS with
curl -k
, a man-in-the-middle can steal your update key.- When using HTTPS with a paid certificate, a man-in-the-middle with access to a CA can steal your update key (no problem for government agencies, but this is pretty unlikely to happen).
- When using HTTPS with a self-signed certificate and
curl --cacert server.crt
, no man-in-the-middle can steal your update key.sftdyn
is pretty minimalistic, and written in python, so it's unlikely to contain any security vulnerabilities. The python ssl and http modules are used widely, and open-source, so there should be no security vulnerabilities there.Somebody who knows a valid udpate key could semi-effectively DOS your server by spamming update requests from two different IPs. For each request, nsupdate would be launched and your zone file updated.-------A self-hosted Dynamic DNS solution similar to DynDNS or NO-IP.
ddns
- Dynamic DNSA self-hosted Dynamic DNS solution similar to DynDNS or NO-IP.You can use a hosted version at ddns.pboehm.de where you can register a host under thed.pboehm.de
domain (e.gtest.d.pboehm.de
).Recent Changesddns
has been fully restructured and now uses the PowerDNS Remote Backend instead of the Pipe Backend, which is far easier to deploy. It now serves both the frontend and the backend over HTTP using different ports.The oldddns
source code can be found at the legacy tag.Security NoticePlease make sure that you use the latest available version ofddns
, as it contains an important security fix for an issue introduced in the rework.How can I update my IP if it changes?
ddns
is built around a small webservice, so that you can update your IP address simply by calling an URL periodically throughcurl
. Hosts that haven't been updated for 10 days will be automatically removed. This can be configured in your own instance.An API similar to DynDNS/NO-IP has not been implemented yet.Self-Hosting
Requirements
- A custom domain where the registrar allows setting
NS
records for subdomains. This is important because not all DNS providers support this.- A server with docker and docker-compose installed
- The following ports should be opened in the firewall:
53/udp
80/tcp
443/tcp
DNS-Setup
For the domain you want to use withddns
(example.net
in the following sections, please adjust this to your domain) you have to create the following two DNS records:
ddns.example.net
as aCNAME
orA
/AAAA
record pointing to the serverddns
will be running on. This record will be used for accessing theddns
frontend in your browser or viacurl
. It is also the target for the correspondingNS
record.d.example.net
as anNS
record pointing to the previously createdddns.example.net
record. This will delegate all subdomains underd.example.net
to the PowerDNS server running onddns.example.net
.
ddns
-SetupSetting upddns
was kind of a hassle in the legacy version, because there are multiple components that have to work together:
ddns
that runs the frontend and provides an API compatible with the Remote Backend- Redis as storage backend for
ddns
- PowerDNS as DNS server, which uses the
ddns
backend API on Port8053
- A web server that makes the
ddns
frontend accessible to the Internet through HTTPSThe setup is now automated using docker-compose and only some customization has to be made in adocker-compose.override.yml
file (a sample is available here).Configuring the Setup
The setup included in this repository contains all the components described above and uses caddy as a web server, because it provides automatic HTTPS using Lets Encrypt.git clone git@github.com:pboehm/ddns.git cd ddns/docker cp docker-compose.override.yml.sample docker-compose.override.yml
Please adjust the settings indocker-compose.override.yml
marked with the#<<< ....
comments as follows:
- adjust the domain part in lines marked with
# <<< ADJUST DOMAIN
according to your DNS-Setup- insert your email address in lines marked with
# <<< INSERT EMAIL
which is required for getting certificates from Lets Encrypt- adjust the path component before the
:
in lines marked with# <<< ADJUST LOCAL PATH
if the shown path does not meet your requirementsFinally execute the followingdocker-compose
command, which creates 4 containers in detached mode which are also started automatically after reboot. For updating an existing installation use the same command because it automatically rebuilds the containers.docker-compose --project-name ddns up -d --build
from
https://github.com/pboehm/ddns-------Dynamic DNS client for IPFire.
ddns A simple, extensible, cross-distribution, cross-platform dynamic DNS updater written in Python. WEB HOME: http://git.ipfire.org/?p=ddns.git;a=summary BUG TRACKER: https://bugzilla.ipfire.org/ Product: DDNS Updater LICENSE: The authors licensed their work as free software under the terms of the GNU GENERAL PUBLIC LICENSE v3.0+ Any content besides source code (images, etc.) is licensed under the terms of the Creative Commons Attribution ShareAlike 3.0 Unported license. INSTALLATION: REQUIREMENTS: ddns is written in Python and does not require any third-party modules. The minumum version of Python that has been tested is Python 2.7. Building the program from source code requires: * GNU make * intltool Building from the source repository additionally requires: * autoconf * automake INSTRUCTIONS: If the configure script does not exist, please run: ./autogen.sh Then run: ./configure --prefix=/usr --sysconfdir=/etc make make install SUPPORTED PROVIDERS: all-inkl.com changeip.com ddnss.de dhs.org dns.lightningwirelabs.com dnsmadeeasy.com dnspark.com do.de domains.google.com domopoli.de dtdns.com duckdns.org dy.fi dyndns.org dyns.cx|net dynu.com easydns.com enom.com entrydns.net freedns.afraid.org itsdns.de joker.com loopia.se myonlineportal.net namecheap.com no-ip.com now-dns.com nsupdate.info opendns.com ovh.com regfish.com schokokeks.org selfhost.de servercow.de spdns.org strato.com twodns.de udmedia.de variomedia.de xlhost.de zoneedit.com zzzz.io Also supports DNS updates via the ISC BIND nsupdate utility. CONTRIBUTE: This is an Open Source and platform-independent project where everyone is welcome to contribute improvements or support for additional providers. Please only send patches to the official mailing list: ddns@lists.ipfire.org Use the standard Git patch format as described here http://wiki.ipfire.org/devel/git/commit-messages and follow the general IPFire contribution guidelines http://wiki.ipfire.org/devel/submit-patches Please refrain from sending patches on GitHub or any other platforms where this repository is mirrored.from https://github.com/ipfire/ddns-------------Dynamic DNS server in PHP. Works with FritzBox.
Dynamic DNS Server
Upload this script to any PHP-enabled webspace and let FritzBox call it. It will work with other DynDNS-Clients as well.Usage
- Upload everything to your webspace
- (you may want to hide data.json and ip.template.html from your webroot)
- Update the config section in update.php
- Update your Dynamic DNS FritzBox settings
- If you want to broadcast the new IP to other services (e.g. your domain registrar or whatever) look for @todo and implement it here
Domain Registrar APIs (@todo)
- https://www.inwx.de/de/download/file/api-current.zip
- http://blog.philippklaus.de/blog/2011/05/31/access-the-internetworx-xml-rpc-api-via-python/
- https://github.com/pklaus/python-inwx-xmlrpc
- http://patrick.oberdorf.net/2011/10/07/inwx-de-als-dyndns/
FritzBox 7360 Settings
Name Value Update-URL http://example.com/update.php?ip4addr= &ip6addr= &user= &password= &domain= Domain anything you want, but make sure its a valid URL, e.g. www.example.com User username from your config (in update.php) Password password from your config (in update.php) Example URL calls
-----
http://example.com/update.php?user=XXX&password=XXX&ip4addr=0.0.0.0&ip6addr=0:0:0:0:0:0:0:0
http://example.com/update.php?user=XXX&password=XXX&ip4addr=0.0.0.0
http://example.com/update.php?user=XXX&password=XXX&ip6addr=0:0:0:0:0:0:0:0
http://example.com/update.php?user=XXX&password=XXX&reset=1
http://example.com/ip.html (if IP_HTML_PAGE is set)
dynamic dns (dyndns) update client with support for multiple protocols https://pypi.org/project/dyndnsc/Dyndnsc - dynamic dns update client
Dyndnsc is a command line client for sending updates to dynamic dns (ddns, dyndns) services. It supports multiple protocols and services, and it has native support for ipv6. The configuration file allows using foreign, but compatible services. Dyndnsc ships many different IP detection mechanisms, support for configuring multiple services in one place and it has a daemon mode for running unattended. It has a plugin system to provide external notification services.Quickstart / Documentation
See the Quickstart section of the https://dyndnsc.readthedocs.io/Installation
# from pypi: pip install dyndnsc # using docker: docker pull infothrill/dyndnsc-x86-alpine # from downloaded source: python setup.py install # directly from github: pip install https://github.com/infothrill/python-dyndnsc/zipball/developRequirements
- Python 2.7 or 3.4+
Machines on dynamic IPs can call this service at regular intervals (e.g. via cron) and when the server notices an address change it makes the relevant API call to update the DNS provider. Alternatively a simple DNS server is included which can be run instead of using an external DNS provider.django-dynamic-dns
It is common to have a server or NAS on a home network that you would like to be able to occasionally access from other locations across the internet. However, most home internet connections have dynamically-assigned IP addresses which change every few days so you need to use a dynamic DNS service located on a static IP address. This project implements a flexible dynamic DNS service written in Python using the Django web framework.
Machines on dynamic IPs can call this service at regular intervals (e.g. via cron) and when the server notices an address change it makes the relevant API call to update the DNS provider. Alternatively a simple DNS server is included which can be run instead of using an external DNS provider - see the section Built-in DNS Server below for more details. You will need your own domain name set with the nameservers to a DNS provider controlled via API or your own instance of the built-in DNS server.
It's recommended that new users check out the
sampleproject
for an example setup.Domains/subdomains that are going to be managed as aliases to dynamic IP addresses are added to the database through Django's admin interface. The last known IP for a domain is stored against the name so the service knows whether the IP is different from what it was previously. A plugin infrastructure is in place which makes it easy to add new DNS service providers. So far Rackspace Cloud DNS and DigitalOcean are the only DNS service plugins included but I'd be very happy to receive contributions for other ones.
Server configuration
Before adding your domains to the system, you will need to make a couple of additions to Django's
settings.py
. Add'dynamicdns'
to yourINSTALLED_APPS
. Configure which DNS provider(s) you are going to use along with whatever parameters are required by the plugin.INSTALLED_APPS = ( 'django.contrib.admin', ... 'dynamicdns', ) DYNAMICDNS_PROVIDERS = { 'dummy': { 'plugin': 'dynamicdns.plugins.Dummy', }, 'rackspace': { 'plugin': 'dynamicdns.plugins.Rackspace', 'username': 'YOUR_USERNAME', 'api_key': 'YOUR_API_KEY', }, 'digitalocean': { 'plugin': 'dynamicdns.plugins.DigitalOcean', 'client_id': 'YOUR_CLIENT_ID', 'api_key': 'YOUR_API_KEY', }, }
URL configuration
You will need to add the url to your existing urls.py and make you have django admin set up too. This is from the
sampleproject
example:url(r'^dynamicdns/', include('dynamicdns.urls')),
Admin configuration
Add a new DnsRecord in the Django Admin. These are the properties that can be set:
- Domain (required): The domain name that is to be an alias to a dynamic IP - should not contain a dot
.
at the end as in some DNS tools.- IP: Used for the alias - will get filled in when the scheduled update command runs.
- LAN IP: Only required when using the Built-in DNS server - should be the IP address you use to access it on your internal network e.g. 192.168.x.x or 10.x.x.x.
- Key: A secret (like a password) that must be provided when the scheduled job update job is run - leave the field blank and a random one will be generated.
- Provider: Options which were configured in
settings.py
underDYNAMICDNS_PROVIDERS
. This should be left blank if using the built-in DNS server.- Last change: Will show when the IP address last changed - leave blank.
Client configuration
The easiest way to set up the machine that will be running on a dynamic IP is to create a new cron job (
crontab -e
) that POSTs the domain's secret key to the relevant update URL. This cron line would make sure your machine is not unreachable for more than 15 minutes.*/15 * * * * curl https://example.com/dynamicdns/update/a.example.com/ --data "key=ZHXPu3RTfs3oAexrwBTi8DGN5lmiH3t1pc9iGG1NZsp75UeM84"
If, for some reason, you want to supply an IP address rather than let the server determine it automatically, you can supply an
ip
parameter like this:curl https://example.com/dynamicdns/update/a.example.com/ --data "key=ZHXPu3RTfs3oAexrwBTi8DGN5lmiH3t1pc9iGG1NZsp75UeM84&ip=1.2.3.4"
Security
It is highly recommend that you run the Django project behind a server that supports SSL/TLS with a certificate signed by an authority, otherwise people will be able to override where your domain points. Your client configuration (i.e. curl command) should always use
https://
to begin the URL. Whilst a self-signed certificate can offer protection, you will want to make sure that curl (or alternative) is checking the certificate the server provides against a CA list that includes the fake CA you created. Disabling certificate authority checking or using a library likeurllib
(which doesn't do certificate verification by default) leaves you vulnerable to man-in-the-middle (MITM) attacks.Built-in DNS Server
A simple Python DNS server is included in this package which can be used instead of using an external service. Whilst you would not want to use it for a high-traffic site, it does have it's own advantages.
Unlike any DNS service I know, this server can return an IP address depending on the location of the client requesting a lookup. Say you have a server or some kind of NAS on your home network. Most of the time you access it from within your home and would like to address it at 192.168.1.100 to avoid any looping back of packets to the router or internet, improving speed. By storing the server's LAN address as well as the WAN address of the router, the internal DNS server can identify if a client requesting a lookup is from the same WAN IP and in that case return the LAN address of the server.
This DNS server also has a very small TTL value (1 second) so you shouldn't run in to caching issues - note that a lot of external providers will not let you have a TTL less than approximately 5 minutes.
The built-in DNS server needs to run with suppicient permissions to listen on UDP port 53. If you are using a virtualenv you can use a combination of
sudo
and specifying whichpython
to use.sudo /PATH/TO/VIRTUALENV/bin/python manage.py run_dns_server
When testing this out it is useful to learn a few
dig
commands. This will perform a basic lookup of a domain using your local built-in DNS server:dig @127.0.0.1 a.example.com.
You should get a response similar to the following. Note the
ANSWER SECTION
in the response should show the domain name with the IP address.; <<>> DiG 0.0.0 <<>> @127.0.0.1 a.example.com. ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8559 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;a.example.com. IN A ;; ANSWER SECTION: a.example.com. 1 IN A 192.168.1.100 ;; Query time: 1 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Wed Jan 15 23:50:01 GMT 2014 ;; MSG SIZE rcvd: 69
You're most likely going to want to bind subdomains to your instance of the built-in DNS server using
NS
records. I found that delegating a subdomain to a different nameserver on Rackspace Cloud DNS was a bit tricky as the user interface on their control panel doesn't allow you to do it. This tutorial showed it was possible on Rackspace using their API: http://wherenow.org/delegating-a-subdomain-with-rackspace-cloud-dns/DNS Debugging
Here's a few quick
dig
commands that are helpful for getting things working.Check a domain is managed by intended name servers:
dig +short NS a.example.com.
Check a domain has an alias and points to a certain IP address:
dig +short A a.example.com.
Show all other DNS info for a domain:
dig a.example.com.
Query a specific DNS server like
127.0.0.1
for the in-built server or8.8.8.8
for Google's servers by using@
and then a DNS IP:dig @127.0.0.1 a.example.com.
Future features
- Adding more DNS provider plugins
- Support for DNSSEC in the built-in DNS server
Releasing
First update the version numbers in
setup.py
then run the following to upload source and wheel packages.from https://github.com/damianmoore/django-dynamic-dns ------------------- https://github.com/LINKIWI/cloudflare-ddns-client ------------------- https://github.com/karalabe/cloudflare-dyndns ------------------python setup.py sdist upload python setup.py bdist_wheel upload
https://github.com/mrprintedwall/cloudflare-as-dynamic-dns ---------------- https://github.com/michaelkourlas/node-cloudflare-dynamic-dns ---------------- ddns support dns: cloudflare frm https://github.com/orvice/ddns ------ https://github.com/TamirSlo/Automatic-Cloudflare-DNS-Record-Updater
-----
freemyip 免费二级域名注册,支持通过访问链接更新ip
freemyip提供免费的二级域名注册,注册简单,连邮箱都不需要,不用填写任何资料。支持A、redirectURL、AAAA、TXT等类型的记录,可以创建子域名。
注册地址:https://freemyip.com/
freemyip免费子域名freemyip免费子域名
打开首页,输入想要的域名,点查询按钮。如果可用,再点击提交按钮。
此时会获得一个token很重要,是唯一的使用方法。如果您丢失了它,就将无法使用域名。也无法恢复权限!
每次更改A记录的时候,访问如下链接:
https://freemyip.com/update?token=YOUR_TOKEN&domain=YOUR_DOMAIN.freemyip.com
便会设为本机ip。如果像指定ip,则访问如下链接:
https://freemyip.com/update?token=YOUR_TOKEN&domain=YOUR_DOMAIN.freemyip.com&myip=1.2.3.4
域名、token、ip都换成自己的(子域名也可以)。看到返回ok字样代表更新成功。
还有一些其它记录设置方法(如通过特定路由器固件自动更新),详见帮助页面:https://freemyip.com/help
如果删除域名,可在链接后加上“&delete=yes”参数来执行删除操作。但请注意:域名将被永久删除,并且无法在 12 个月内创建相同的子域(这是为了防止其他人“窃取”您已删除的子域)。
freemyip免费域名明确要求至少一年更新一次记录,即使ip没有变化也要保持一下活跃。 你注册的域名可以通过在‘hostmon免费网站在线监控工具’添加一个任务,来定时访问带有TOKEN的链接来保持活跃,理论上可以长期使用。
(hostmon 免费网站在线监控工具
hostmon免费网站在线监控和之前的dynamix免费子域名和免费的动态域名是一家的。当您受监控的站点遇到中断或重新上线时,平台将向您发送通知电子邮件。免费用户科创建多达 5 个受监控 URL 和站点的离线和停机警报。
注册简单只需邮箱验证链接即可,无需手机号和信用卡。
注册地址:https://hostmon.net/index.php
平台收集正常运行时间和停机时间统计信息。在您的网站上嵌入正常运行时间小部件以吹嘘您的正常运行时间。对于网络托管服务提供商或任何想要确保其网站在线且可访问的人都很有用。每 2 分钟检查一次受监控的 URL。
注册之后登录账号,直接可以添加网址,无需验证网站所有权。
添加网站检测添加网站检测
检测访客的ua:
Host Mon Monitoring Agent 1.0)
No comments:
Post a Comment