Code Monkey home page Code Monkey logo

godns's Introduction

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

Release MIT licensed Build Status Downloads Docker Go Report Card

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.

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

  • 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!

godns's People

Contributors

timothyye avatar gunsluo avatar sdandroid avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.