MCPcopy Index your code
hub / github.com/TimothyYe/godns

github.com/TimothyYe/godns @v3.4.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.4.2 ↗ · + Follow
506 symbols 1,353 edges 106 files 152 documented · 30%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
 ██████╗  ██████╗ ██████╗ ███╗   ██╗███████╗
██╔════╝ ██╔═══██╗██╔══██╗████╗  ██║██╔════╝
██║  ███╗██║   ██║██║  ██║██╔██╗ ██║███████╗
██║   ██║██║   ██║██║  ██║██║╚██╗██║╚════██║
╚██████╔╝╚██████╔╝██████╔╝██║ ╚████║███████║
 ╚═════╝  ╚═════╝ ╚═════╝ ╚═╝  ╚═══╝╚══════╝

Apache licensed Docker Go Report Card GoDoc

GoDNS is a self-hosted dynamic DNS (DDNS) client with multi-provider support and a built-in web panel. It is a rewrite in Go of my early DynDNS open-source project.

查看中文帮助文档

Hosted version

If you want a managed DDNS service instead of self-hosting GoDNS yourself, try godns.app.

It is a hosted option for users who want DDNS without running their own server, managing DNS manually, or even owning a domain in advance.

Below is the built-in web panel of the open-source GoDNS project:


Supported DNS Providers

Provider IPv4 support IPv6 support Root Domain Subdomains
Cloudflare :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
DigitalOcean :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
Google Domains :white_check_mark: :white_check_mark: :x: :white_check_mark:
DNSPod :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
Dynv6 :white_check_mark: :white_check_mark: :x: :white_check_mark:
HE.net (Hurricane Electric) :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
AliDNS :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
DuckDNS :white_check_mark: :white_check_mark: :x: :white_check_mark:
Dreamhost :white_check_mark: :white_check_mark: :x: :white_check_mark:
No-IP :white_check_mark: :white_check_mark: :x: :white_check_mark:
Scaleway :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
Linode :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
Strato :white_check_mark: :white_check_mark: :x: :white_check_mark:
LoopiaSE :white_check_mark: :white_check_mark: :x: :white_check_mark:
Infomaniak :white_check_mark: :white_check_mark: :x: :white_check_mark:
Hetzner :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
OVH :white_check_mark: :white_check_mark: :x: :white_check_mark:
Porkbun :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
Dynu :white_check_mark: :white_check_mark: :x: :white_check_mark:
IONOS :white_check_mark: :white_check_mark: :x: :white_check_mark:
TransIP :white_check_mark: :white_check_mark: :x: :white_check_mark:

Tip: You can follow this issue to view the current status of DDNS for root domains.

Quick Start

Choose the path that fits you best:

Supported Platforms

  • Linux
  • MacOS
  • ARM Linux (Raspberry Pi, etc.)
  • Windows
  • MIPS32 platform

To compile binaries for MIPS (mips or mipsle), run:

bash GOOS=linux GOARCH=mips/mipsle GOMIPS=softfloat go build -a

The binary can run on routers as well.

Self-hosting Pre-conditions

To self-host GoDNS, it is assumed:

  • You registered (now own) a domain
  • Domain was delegated to a supported DNS provider (i.e. it has nameserver NS records pointing at a supported provider)

Alternatively, you can sign in to DuckDNS (with a social account) and get a subdomain on the duckdns.org domain for free.

Installation

Choose one of the following installation methods:

cd cmd/godns        # go to the GoDNS directory
go mod download     # get dependencies
go build            # build

Usage

Print usage/help by running:

$ ./godns -h
Usage of ./godns:
  -c string
        Specify a config file (default "./config.json")
  -h    Show help

Configuration

Overview

  • Make a copy of config_sample.json and name it as config.json, or make a copy of config_sample.yaml and name it as config.yaml.
  • Configure your provider, domain/subdomain info, credentials, etc.
  • Configure a notification medium (e.g. SMTP to receive emails) to get notified when your IP address changes
  • Place the file in the same directory of GoDNS or use the -c=path/to/your/file.json option

Multi-Provider Support

🆕 GoDNS now supports multiple DNS providers simultaneously!

You can now configure domains from different DNS providers in a single configuration file, allowing you to: - Manage domains across multiple DNS services (Cloudflare, DNSPod, DigitalOcean, etc.) - Use provider-specific credentials for each service - Maintain full backward compatibility with existing single-provider configurations

📖 View the complete Multi-Provider Configuration Guide for detailed setup instructions and examples.

Configuration file format

GoDNS supports 2 different configuration file formats:

  • JSON
  • YAML

By default, GoDNS uses JSON config file. However, you can specify to use the YAML format via: ./godns -c /path/to/config.yaml

Dynamic loading of configuration

GoDNS supports dynamic loading of configuration. If you modify the configuration file, GoDNS will automatically reload the configuration and apply the changes.

Configuration properties

  • provider — One of the supported provider to use: Cloudflare, Google, DNSPod, AliDNS, HE, DuckDNS or Dreamhost.
  • email — Email or account name of the DNS provider.
  • password — Password of the DNS provider.
  • login_token — API token of the DNS provider.
  • domains — Domains list, with your subdomains.
  • ip_urls — A URL array for fetching one's public IPv4 address.
  • ipv6_urls — A URL array for fetching one's public IPv6 address.
  • ip_type — Switch deciding if IPv4 or IPv6 should be used (when supported). Available values: IPv4 or IPv6.
  • interval — How often (in seconds) the public IP should be updated.
  • socks5_proxy — Socks5 proxy server.
  • resolver — Address of a public DNS server to use. For instance to use Google's public DNS, you can set 8.8.8.8 when using GoDNS in IPv4 mode or 2001:4860:4860::8888 in IPv6 mode.
  • skip_ssl_verify - Skip verification of SSL certificates for https requests.

Update root domain

By simply putting @ into sub_domains, for example:

"domains": [{
      "domain_name": "example.com",
      "sub_domains": ["@"]
    }]

Configuration examples

Cloudflare

For Cloudflare, you need to provide the email & Global API Key as a password (or to use the API token) and configure all the domains & subdomains.

By setting the option proxied = true, the record receives the performance and security benefits of Cloudflare. This option is only available for Cloudflare.

Using email & Global API Key

{
  "provider": "Cloudflare",
  "email": "you@example.com",
  "password": "Global API Key",
  "domains": [
    {
      "domain_name": "example.com",
      "sub_domains": ["www", "test"]
    },
    {
      "domain_name": "example2.com",
      "sub_domains": ["www", "test"]
    }
  ],
  "resolver": "8.8.8.8",
  "ip_urls": ["https://api.ip.sb/ip"],
  "ip_type": "IPv4",
  "interval": 300,
  "socks5_proxy": "",
  "proxied": false
}

Using the API Token

{
  "provider": "Cloudflare",
  "login_token": "API Token",
  "domains": [
    {
      "domain_name": "example.com",
      "sub_domains": ["www", "test"]
    },
    {
      "domain_name": "example2.com",
      "sub_domains": ["www", "test"]
    }
  ],
  "resolver": "8.8.8.8",
  "ip_urls": ["https://api.ip.sb/ip"],
  "ip_type": "IPv4",
  "interval": 300,
  "socks5_proxy": ""
}

DNSPod

For DNSPod, you need to provide your API Token(you can create it here), and config all the domains & subdomains.

Example

{
  "provider": "DNSPod",
  "login_token": "your_id,your_token",
  "domains": [
    {
      "domain_name": "example.com",
      "sub_domains": ["www", "test"]
    },
    {
      "domain_name": "example2.com",
      "sub_domains": ["www", "test"]
    }
  ],
  "resolver": "8.8.8.8",
  "ip_urls": ["https://api.ip.sb/ip"],
  "ip_type": "IPv4",
  "interval": 300,
  "socks5_proxy": ""
}

DigitalOcean

For DigitalOcean, you need to provide an API Token with the domain scopes (you can create it here), and config all the domains & subdomains.

Example

{
  "provider": "DigitalOcean",
  "login_token": "dop_v1_00112233445566778899aabbccddeeff",
  "domains": [
    {
      "domain_name": "example.com",
      "sub_domains": ["@", "www"]
    }
  ],
  "resolver": "8.8.8.8",
  "ip_urls": ["https://api.ip.sb/ip"],
  "ip_type": "IPv4",
  "interval": 300
}

Dreamhost

For Dreamhost, you need to provide your API Token(you can create it here), and config all the domains & subdomains.

Example

{
  "provider": "Dreamhost",
  "login_token": "your_api_key",
  "domains": [
    {
      "domain_name": "example.com",
      "sub_domains": ["www", "test"]
    },
    {
      "domain_name": "example2.com",
      "sub_domains": ["www", "test"]
    }
  ],
  "resolver": "8.8.8.8",
  "ip_urls": ["https://api.ip.sb/ip"],
  "ip_type": "IPv4",
  "interval": 300,
  "resolver": "ns1.dreamhost.com",
  "socks5_proxy": ""
}

Dynv6

For Dynv6, only need to provide the token, config 1 default domain & subdomains.

Example

{
  "provider": "Dynv6",
  "password": "",
  "login_token": "1234567ABCDEFGabcdefg123456789",
  "domains": [
    {
      "domain_name": "dynv6.net",
      "sub_domains": ["myname"]
    }
  ],
  "resolver": "8.8.8.8",
  "ip_urls": ["https://api.ip.sb/ip"],
  "ip_type": "IPv4",
  "interval": 300,
  "socks5_proxy": ""
}

Google Domains

For Google Domains, you need to provide email & password, and config all the domains & subdomains.

Example

```json { "provider": "Google", "email": "Your_Username", "password": "

Extension points exported contracts — how you extend this code

INotification (Interface)
(no doc) [8 implementers]
pkg/notification/manager.go
IDNSProvider (Interface)
(no doc) [23 implementers]
internal/provider/provider.go
IpModeProps (Interface)
(no doc)
web/components/ip-mode.tsx
Domain (Interface)
(no doc)
web/api/domain.ts
INotificationManager (Interface)
(no doc) [8 implementers]
pkg/notification/manager.go
ProviderConfigForm (Interface)
(no doc)
web/components/multi-provider-control.tsx
WebHook (Interface)
(no doc)
web/api/network.ts
LogEntryProps (Interface)
(no doc)
web/components/log-entry.tsx

Core symbols most depended-on inside this repo

Add
called by 66
pkg/lib/log_buffer.go
Run
called by 44
internal/manager/dns_manager.go
CheckSettings
called by 37
internal/utils/settings.go
GetProviders
called by 30
internal/provider/factory.go
GetHTTPClient
called by 23
internal/utils/http.go
GetProviderForDomain
called by 17
internal/provider/factory.go
get_api_server
called by 17
web/api/env.ts
GetDomainProvider
called by 14
internal/settings/settings.go

Shape

Method 196
Function 189
Struct 97
Interface 24

Languages

Go76%
TypeScript24%

Modules by API surface

internal/utils/settings.go28 symbols
internal/settings/settings.go22 symbols
web/components/icons.tsx19 symbols
web/components/multi-provider-control.tsx16 symbols
internal/provider/cloudflare/cloudflare_handler.go16 symbols
pkg/lib/log_buffer.go13 symbols
internal/provider/digitalocean/digitalocean_provider.go13 symbols
pkg/lib/ip_helper.go12 symbols
internal/provider/porkbun/porkbun_handler.go12 symbols
internal/provider/hetzner/hetzner_handler.go12 symbols
internal/provider/ionos/ionos_handler.go11 symbols
web/api/provider.ts10 symbols

For agents

$ claude mcp add godns \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact