A dynamic DNS client tool, supports DNSPod & HE.net, written in Go.
![Release]()
![MIT licensed]()
![Build Status]()
![Docker]()
![Go Report Card]()
![Cover.Run]()
![GoDoc]()
GoDNS is a dynamic DNS (DDNS) client tool, it is based on my early open source project: DynDNS.
Now I rewrite DynDNS by Golang and call it GoDNS.
![]()
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.
Notification mail example:
![]()
Now all the queries will go through the specified SOCKS5 proxy.
GoDNS is a dynamic DNS (DDNS) client tool, it is based on my early open source project: DynDNS.
Now I rewrite DynDNS by Golang and call it GoDNS.
Supported DNS Provider
- DNSPod (https://www.dnspod.cn/)
- HE.net (Hurricane Electric) (https://dns.he.net/)
Supported Platforms
- Linux
- MacOS
- ARM Linux (Raspberry Pi, etc...)
- Windows
For MIPS32 platform, please checkout the MIPS32 platformmips32 branch, this branch is contributed by hguandl, in this branch, the support for mips32 is added, which means it could run properly on Openwrt and LEDE.
Pre-condition
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 compiled binaries from Download from releasesreleases
Get help
$ ./godns -h
Usage of ./godns:
-c string
Specify a config file (default "./config.json")
-d Run it as docker mode
-h Show help
Config it
- Get config_sample.json from Github.
- Rename it to config.json.
- Configure your provider, domain/sub-domain 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.
For DNSPod, you need to provide email & password, and config all the domains & subdomains. Config example for DNSPod
{
"provider": "DNSPod",
"email": "example@gmail.com",
"password": "YourPassword",
"login_token": "",
"domains": [{
"domain_name": "example.com",
"sub_domains": ["www","test"]
},{
"domain_name": "example2.com",
"sub_domains": ["www","test"]
}
],
"ip_url": "http://members.3322.org/dyndns/getip",
"log_path": "./godns.log",
"socks5_proxy": ""
}
For HE, email is not needed, just fill DDNS key to password, and config all the domains & subdomains. Config example for HE.net
{
"provider": "HE",
"email": "",
"password": "YourPassword",
"login_token": "",
"domains": [{
"domain_name": "example.com",
"sub_domains": ["www","test"]
},{
"domain_name": "example2.com",
"sub_domains": ["www","test"]
}
],
"ip_url": "http://members.3322.org/dyndns/getip",
"log_path":"/users/timothy/workspace/src/godns/godns.log",
"socks5_proxy": ""
}
Add a new "A record", make sure that "Enable entry for dynamic dns" is checked: HE.net DDNS configuration

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.
Update config file and provide your SMTP options, a notification mail will be sent to your mailbox once the IP is changed and updated. Email notification support
"notify": {
"enabled": true,
"smtp_server": "smtp.example.com",
"smtp_username": "user",
"smtp_password": "password",
"smtp_port": 25,
"send_to": "my_mail@example.com"
}

You can also use SOCKS5 proxy, just fill SOCKS5 address to the SOCKS5 proxy support
socks5_proxy
item:"socks5_proxy": "127.0.0.1:7070"
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 godns
Run 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
Now godns supports to run in docker. Run it with 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:latest
from https://github.com/TimothyYe/godns
-------
开源项目: GoDNS
记得之前写过一个开源的DDNS工具: DynDNS,基于Ruby开发,用在PT下载机上感觉还不错,
让我随时可以在公司通过动态域名访问到家里的下载机。
最近学Golang,有了个打算,就是用Golang把这个工具给重写一次。于是,就有了这个开源项目:GoDNS
跟Ruby版本的DynDNS相比,GoDNS用起来更加方便,由于是直接编译为可执行文件,所以在使用的时候,
你不用搭建Ruby环境,安装各种依赖组件,修改好配置文件后,就可以直接运行了.
FROM https://xiaozhou.net/godns-project-2014-05-18.html