1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00
2017-08-16 00:30:41 +08:00
2017-03-23 09:01:33 +08:00
2017-08-16 00:30:41 +08:00
2016-05-11 16:04:43 +08:00
2017-07-19 21:56:32 +08:00
2017-02-15 19:12:09 +08:00
2017-07-19 13:53:19 +08:00
2016-08-31 10:14:29 +08:00
2016-05-25 15:18:22 +08:00
2016-05-25 15:18:22 +08:00
2017-04-10 20:44:30 +08:00
2014-05-11 04:49:17 -07:00
2017-08-10 00:37:02 +08:00
2016-06-30 21:02:12 +08:00
2017-07-19 13:53:19 +08:00
2016-06-30 21:02:12 +08:00

 ██████╗  ██████╗ ██████╗ ███╗   ██╗███████╗
██╔════╝ ██╔═══██╗██╔══██╗████╗  ██║██╔════╝
██║  ███╗██║   ██║██║  ██║██╔██╗ ██║███████╗
██║   ██║██║   ██║██║  ██║██║╚██╗██║╚════██║
╚██████╔╝╚██████╔╝██████╔╝██║ ╚████║███████║
 ╚═════╝  ╚═════╝ ╚═════╝ ╚═╝  ╚═══╝╚══════╝

Latest release: V1.1

Build Status

GoDNS is a dynamic DNS (DDNS) tool, it is based on my early open source project: DynDNS.

Now I rewrite DynDNS by Golang and call it GoDNS.

Pre-condition

  • GoDNS relies on DNSPod and its API.

  • To use GoDNS, you need a domain hosted on DNSPod.

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 domain/sub-domain info, username and password of DNSPod account.
  • Configure log file path, max size of log file, max count of log file.
  • Configure user id, group id for safety.
  • Save it in the same directory of GoDNS, or use -c=your_conf_path command.

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 in docker

Now godns supports to run in docker.

  • Pull godns image from docker hub:
docker pull timothyye/godns:1.0
  • Run godns in container and pass config parameters to it via enviroment variables:
docker run -d --name godns --restart=always \
-e EMAIL=your_dnspod_account \
-e PASSWORD=your_dnspod_password \
-e DOMAINS="your_domain1,your_domain2" DOCKER_IMAGE_ID                                                                                              

Enjoy it!

Description
A dynamic DNS client tool supports AliDNS, Cloudflare, Google Domains, DNSPod, HE.net & DuckDNS & DreamHost, etc, written in Go.
Readme 1.5 MiB
Languages
Go 97.4%
Makefile 2.3%
Dockerfile 0.3%