mirror of
https://github.com/taigrr/godns
synced 2025-01-18 04:03:25 -08:00
██████╗ ██████╗ ██████╗ ███╗ ██╗███████╗
██╔════╝ ██╔═══██╗██╔══██╗████╗ ██║██╔════╝
██║ ███╗██║ ██║██║ ██║██╔██╗ ██║███████╗
██║ ██║██║ ██║██║ ██║██║╚██╗██║╚════██║
╚██████╔╝╚██████╔╝██████╔╝██║ ╚████║███████║
╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝
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/)
MIPS32 platform
For MIPS32 platform, please checkout the mips32 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
Build it
Get & 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 godns
go get
go build
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 log file path, max size of log file, max count of log file.
- Save it in the same directory of GoDNS, or use -c=your_conf_path command.
Config example for DNSPod
For DNSPod, you need to provide email & password, and config all the domains & subdomains.
{
"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",
"log_size": 16,
"log_num": 3,
"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",
"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",
"log_size":16,
"log_num":3,
"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":
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
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:1.2
Enjoy it!
Description
A dynamic DNS client tool supports AliDNS, Cloudflare, Google Domains, DNSPod, HE.net & DuckDNS & DreamHost, etc, written in Go.
Languages
Go
97.4%
Makefile
2.3%
Dockerfile
0.3%