# GodDNS

```
   ______              __   ____     _   __        
  / ____/  ____   ____/ /  / __ \   / | / /  _____
 / / __   / __ \ / __  /  / / / /  /  |/ /  / ___/
/ /_/ /  / /_/ // /_/ /  / /_/ /  / /|  /  (__  ) 
\____/   \____/ \__,_/  /_____/  /_/ |_/  /____/  
                         .___  .___             
   ____   ____         __| _/__| _/____   ______
  / ___\ /  _ \  ___  / __ |/ __ |/    \ /  ___/
 / /_/  >  <_> ) --- / /_/ / /_/ |   |  \\___ \ 
 \___  / \____/      \____ \____ |___|  /____  |
/_____/                   \/    \/    \/     \/ 
                                               
                                                
```

![GitHub](https://img.shields.io/github/license/Equationzhao/GoDDNS) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/18444501bfd44f919c3a4c87b4e8fcaf)](https://app.codacy.com/gh/Equationzhao/GoDDNS/dashboard?utm_source=gh\&utm_medium=referral\&utm_content=\&utm_campaign=Badge_grade) [![CodeFactor](https://www.codefactor.io/repository/github/equationzhao/goddns/badge)](https://www.codefactor.io/repository/github/equationzhao/goddns)

![GitHub last commit](https://img.shields.io/github/last-commit/Equationzhao/GoDDNS) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/Equationzhao/GoDDNS) [![Go](https://github.com/Equationzhao/GodDns/actions/workflows/go.yml/badge.svg)](https://github.com/Equationzhao/GodDns/actions/workflows/go.yml)

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FEquationzhao%2FGoDDNS.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FEquationzhao%2FGoDDNS?ref=badge_large)

a DDNS tool written in go

## Intro

generate a default config file

```bash
GodDns generate
```

use ip set in config

```bash
GodDns run
```

use ip address of interface set in config

```bash
GodDns run auto 
```

get ip address from api

```bash
GodDns run --api=ipify/identMe/others
```

through proxy

```bash
GodDns run --proxy=http://127.0.0.1:10809
GodDns run --proxy=enable
GodDns run --proxy=disable
```

parallel executing

```bash
GodDns run --parallel
```

## Usage

```bash
USAGE:
   GodDns [global options] command [command options] [arguments...]
   GodDns run - run the DDNS service
   GodDns run auto - run ddns, use ip address of interface set in Device Section automatically
   GodDns run auto override - run ddns, override the ip address of interface set in each service Section
   GodDns generate - generate a default configuration file
   GodDns show-config service/section - show the configuration of a service/section *case insensitive*
   GodDns show-config ls - list all available services/sections
```

```
COMMANDS:
   run, r, R       run the DDNS service 
   [--api ApiName, -i ApiName, -I ApiName  get ip address from provided ApiName, eg: ipify/identMe]
	   auto, a, A  run ddns, use ip address of interface set in Device Section automatically
   			override, o, O  run ddns, override the ip address of interface set in each service Section

COMMANDS:
   generate, g, G  generate a default configuration file
   help, h         Shows a list of commands or help for one command
   show-config, sc, SC  show the configuration of a service/section *case insensitive*
   show-config ls       list all available services/sections
   help, h              Shows a list of commands or help for one command
   
OPTIONS:
   --all, -a, -A  show all available services/sections configuration (default: false)

   CONFIG

   --config file, -c file, -C file, --Config file  set configuration file

   OUTPUT

   --log level, -l level, -L level, --Log level  level: Trace/Debug/Info/Warn/Error (default: Info)
   --no-output, -s, -S, --silent                 no message output (default: false)
   --print-in-markdown, --md, --markdown, --pim  print result in markdown (default: disabled)
   --print-in-table, --pt, --table, --pit        print result in table (default: disabled)
   
   PERFORMANCE

   --cpu-profile, --cpuprofile, --cpu, --cp  enable cpu profiling (default: disabled)
   --mem-profile, --memprofile, --mem, --mp  enable memory profiling (default: disabled)
   
   RUN

   --api ApiName, -i ApiName, -I ApiName     get ip address from provided ApiName, eg: ipify/identMe
   --parallel, --Parallel                    run ddns parallel (default: false)
   --proxy url, -p url, -P url, --Proxy url  set proxy url
   --retry times                             retry times (default: 3)
    
   TIMES

   --times-limitation n, --tl n, --TL n  run ddns per time(seconds) up to n times (default: infinity)

   TRIGGER

   --on-change, --oc, --OC                 run ddns automatically when ip changed (default: false)
   --time seconds, -t seconds, -T seconds  run ddns per time(seconds) (default: disabled)


GLOBAL OPTIONS:
   --help, -h, -H     show help
   --version, -v, -V  print the version info

```

## Configuration

[Program Config](/go-ddns/core.md)

[Service Config](/go-ddns/service.md)

## Download

download in [release](https://github.com/Equationzhao/GodDns/releases)

## Build from source

build binary

```bash
git clone https://github.com/Equationzhao/GodDns.git
cd GodDns
make build
```

install to $GOPATH/bin

```bash
git clone https://github.com/Equationzhao/GodDns.git
cd GodDns
make install
```

### Arch Linux

```bash
git clone https://aur.archlinux.org/goddns.git
cd goddns
makepkg -si
```

or through aur helper

```bash
yay -S goddns
```

## TODO

* [ ] add more service
* [ ] new feature support multi-device for each service(like Device does)

## Recent activity [![Time period](https://images.repography.com/35290882/Equationzhao/GodDns/recent-activity/q65o3PECpPMnwg4phwoyLACVdMlhp7RSU_ZM56V6IsI/OblplC2Dj_Os64IMBtDy1MYIbUUtq2xrjYEpyDc2C2M_badge.svg)](https://repography.com)

[![Timeline graph](https://images.repography.com/35290882/Equationzhao/GodDns/recent-activity/q65o3PECpPMnwg4phwoyLACVdMlhp7RSU_ZM56V6IsI/OblplC2Dj_Os64IMBtDy1MYIbUUtq2xrjYEpyDc2C2M_timeline.svg)](https://github.com/Equationzhao/GodDns/commits)

## Structure

[![Structure](https://images.repography.com/35290882/Equationzhao/GodDns/structure/q65o3PECpPMnwg4phwoyLACVdMlhp7RSU_ZM56V6IsI/0cmrSCrg47Iro9mgH9R3TCPihAkB0y8Fm-LsJZBNscs_table.svg)](https://github.com/Equationzhao/GodDns)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://equations.gitbook.io/go-ddns/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
