A dynamic DNS client tool supports AliDNS, Cloudflare, Google Domains, DNSPod, HE.net & DuckDNS & DreamHost, etc, written in Go.

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

Apache licensed Docker Go Report Card Cover.Run GoDoc

GoDNS is a dynamic DNS (DDNS) client tool. It is a rewrite in Go of my early DynDNS open source project.

Currently supports updating A records for subdomains. Doesn't support updating of root domains.



Supported DNS Providers

Provider IPv4 support IPv6 support Root Domain Subdomains
Cloudflare
Google Domains
DNSPod
HE.net (Hurricane Electric)
AliDNS
DuckDNS
Dreamhost
No-IP
Scaleway

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

Supported Platforms

  • Linux

  • MacOS

  • ARM Linux (Raspberry Pi, etc.)

  • Windows

  • MIPS32 platform

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

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

    The binary can run on routers as well.

Pre-conditions

To use 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

Build GoDNS by running (from the root of the repository):

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

You can also download a compiled binary from the releases.

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

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

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 sub domains.
  • ip_url — A URL for fetching one's public IPv4 address.
  • ipv6_url — A URL 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.

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 password (or to use the API token) and config all the domains & subdomains.

Using email & Global API Key
{
  "provider": "Cloudflare",
  "email": "[email protected]",
  "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_url": "https://api.ip.sb/ip",
  "ip_type": "IPv4",
  "interval": 300,
  "socks5_proxy": ""
}
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_url": "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_url": "https://api.ip.sb/ip",
  "ip_type": "IPv4",
  "interval": 300,
  "socks5_proxy": ""
}

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_url": "https://api.ip.sb/ip",
  "ip_type": "IPv4",
  "interval": 300,
  "resolver": "ns1.dreamhost.com",
  "socks5_proxy": ""
}

Google Domains

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

Example
{
  "provider": "Google",
  "email": "Your_Username",
  "password": "Your_Password",
  "domains": [{
      "domain_name": "example.com",
      "sub_domains": ["www","test"]
    },{
      "domain_name": "example2.com",
      "sub_domains": ["www","test"]
    }
  ],
  "resolver": "8.8.8.8",
  "ip_url": "https://api.ip.sb/ip",
  "ip_type": "IPv4",
  "interval": 300,
  "socks5_proxy": ""
}

AliDNS

For AliDNS, you need to provide AccessKeyID & AccessKeySecret as email & password, and config all the domains & subdomains.

Example
{
  "provider": "AliDNS",
  "email": "AccessKeyID",
  "password": "AccessKeySecret",
  "login_token": "",
  "domains": [{
      "domain_name": "example.com",
      "sub_domains": ["www","test"]
    },{
      "domain_name": "example2.com",
      "sub_domains": ["www","test"]
    }
  ],
  "resolver": "8.8.8.8",
  "ip_url": "https://api.ip.sb/ip",
  "ip_type": "IPv4",
  "interval": 300,
  "socks5_proxy": ""
}

DuckDNS

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

Example
{
  "provider": "DuckDNS",
  "password": "",
  "login_token": "3aaaaaaaa-f411-4198-a5dc-8381cac61b87",
  "domains": [
    {
      "domain_name": "www.duckdns.org",
      "sub_domains": [
        "myname"
      ]
    }
  ],
  "resolver": "8.8.8.8",
  "ip_url": "https://api.ip.sb/ip",
  "ip_type": "IPv4",
  "interval": 300,
  "socks5_proxy": ""
}

No-IP

Example
{
  "provider": "NoIP",
  "email": "[email protected]",
  "password": "YourPassword",
  "domains": [
    {
      "domain_name": "ddns.net",
      "sub_domains": ["timothyye6"]
    }
  ],
  "ip_type": "IPv4",
  "ip_url": "https://api.ip.sb/ip",
  "resolver": "8.8.8.8",
  "interval": 300,
  "socks5_proxy": ""
}

HE.net

For HE, email is not needed, just fill DDNS key to password, and config all the domains & subdomains.

Example
{
  "provider": "HE",
  "password": "YourPassword",
  "login_token": "",
  "domains": [{
      "domain_name": "example.com",
      "sub_domains": ["www","test"]
    },{
      "domain_name": "example2.com",
      "sub_domains": ["www","test"]
    }
  ],
  "resolver": "8.8.8.8",
  "ip_url": "https://api.ip.sb/ip",
  "ip_type": "IPv4",
  "interval": 300,
  "socks5_proxy": ""
}
Provider configuration

Add a new "A record" and make sure that "Enable entry for dynamic dns" is checked:

Fill in your own DDNS key or generate a random DDNS key for this new created "A record":

Remember the DDNS key and set it in the password property in the configuration file.

NOTICE: If you have multiple domains or subdomains, make sure their DDNS key are the same.

Scaleway

For Scaleway, you need to provide an API Secret Key as the login_token (How to generate an API key), and configure the domains and subdomains. domain_name should equal a DNS zone, or the root domain in Scaleway. TTL for the DNS records will be set to the interval value. Make sure A or AAAA records exist for the relevant sub domains, these can be set up in the Scaleway console.

Example
{
  "provider": "Scaleway",
  "login_token": "API Secret Key",
  "domains": [{
      "domain_name": "example.com",
      "sub_domains": ["www","@"]
    },{
      "domain_name": "samplednszone.example.com",
      "sub_domains": ["www","test"]
    }
  ],
  "resolver": "8.8.8.8",
  "ip_url": "https://api.ip.sb/ip",
  "ip_type": "IPv4",
  "interval": 300
}

Notifications

GoDNS can send a notification each time the IP changes.

Email

Emails are sent over SMTP. Update your configuration with the following snippet:

  "notify": {
    "mail": {
      "enabled": true,
      "smtp_server": "smtp.example.com",
      "smtp_username": "user",
      "smtp_password": "password",
      "smtp_port": 25,
      "send_to": "[email protected]"
    }
  }

Each time the IP changes, you will receive an email like that:

Telegram

To receive a Telegram message each time the IP changes, update your configuration with the following snippet:

  "notify": {
    "telegram": {
      "enabled": true,
      "bot_api_key": "11111:aaaa-bbbb",
      "chat_id": "-123456",
      "message_template": "Domain *{{ .Domain }}* is updated to %0A{{ .CurrentIP }}",
      "use_proxy": false
    },
  }

The message_template property supports markdown. New lines needs to be escaped with %0A.

Slack

To receive a Slack message each time the IP changes, update your configuration with the following snippet:

  "notify": {
    "slack": {
      "enabled": true,
      "bot_api_token": "xoxb-xxx",
      "channel": "your_channel",
      "message_template": "Domain *{{ .Domain }}* is updated to \n{{ .CurrentIP }}",
      "use_proxy": false
    },
  }

The message_template property supports markdown. New lines needs to be escaped with \n.

Discord

To receive a Discord message each time the IP changes, update your configuration with the following snippit:

  "notify": {
    "discord": {
          "enabled": true,
          "bot_api_token": "discord_bot_token",
          "channel": "your_channel",
          "message_template": "(Optional) Domain *{{ .Domain }}* is updated to \n{{ .CurrentIP }}",
        }
  }

Miscellaneous topics

IPv6 support

Most of the providers support IPv6.

To enable the IPv6 support of GoDNS, there are two solutions to choose from:

  1. Use an online service to lookup the external IPv6

    For that:

    • Set the ip_type as IPv6, and make sure the ipv6_url is configured
    • Create an AAAA record instead of an A record in your DNS provider
    Configuration example
    {
      "domains": [
        {
          "domain_name": "example.com",
          "sub_domains": [
            "ipv6"
          ]
        }
      ],
      "resolver": "2001:4860:4860::8888",
      "ipv6_url": "https://api-ipv6.ip.sb/ip",
      "ip_type": "IPv6"
    }
  2. Let GoDNS find the IPv6 of the network interface of the machine it is running on (more on that later).

    For this to happen, just leave ip_url and ipv6_url empty.

    Note that the network interface must be configured with an IPv6 for this to work.

Network interface IP address

For some reasons if you want to get the IP address associated to a network interface (instead of performing an online lookup), you can specify it in the configuration file this way:

  "ip_url": "",
  "ip_interface": "interface-name",

With interface-name replaced by the name of the network interface, e.g. eth0 on Linux or Local Area Connection on Windows.

Note: If ip_url is also specified, it will be used to perform an online lookup first and the network interface IP will be used as a fallback in case of failure.

SOCKS5 proxy support

You can make all remote calls go through a SOCKS5 proxy by specifying it in the configuration file this way:

"socks5_proxy": "127.0.0.1:7070"
"use_proxy": true

Display debug info

To display debug info, set debug_info as true to enable this feature. By default, the debug info is disabled.

  "debug_info": true,

Running GoDNS

There are a few ways to run GoDNS.

As a manual daemon

nohup ./godns &

Note: when the program stops, it will not be restarted.

As a managed daemon (with upstart)

  1. Install upstart first (if not available already)

  2. Copy ./upstart/godns.conf to /etc/init (and tweak it to your needs)

  3. Start the service:

    sudo start godns

As a managed daemon (with systemd)

  1. Install systemd first (it not available already)

  2. Copy ./systemd/godns.service to /lib/systemd/system (and tweak it to your needs)

  3. Start the service:

    sudo systemctl enable godns
    sudo systemctl start godns

As a Docker container

Visit https://hub.docker.com/r/timothyye/godns to fetch the latest docker image.
With /path/to/config.json your local configuration file, run:

docker run \
-d --name godns --restart=always \
-v /path/to/config.json:/config.json \
timothyye/godns:latest

As a Windows service

  1. Download the latest version of NSSM

  2. In an administrative prompt, from the folder where NSSM was downloaded, e.g. C:\Downloads\nssm\ win64, run:

    nssm install YOURSERVICENAME
    
  3. Follow the interface to configure the service. In the "Application" tab just indicate where the godns.exe file is. Optionally you can also define a description on the "Details" tab and define a log file on the "I/O" tab. Finish by clicking on the "Install service" button.

  4. The service will now start along Windows.

Note: you can uninstall the service by running:

nssm remove YOURSERVICENAME

Special Thanks

Thanks JetBrains for sponsoring this project with free open source license.

I like GoLand, it is an amazing and productive tool.

Owner
Timothy
A developer, a gopher, a Vimer, an Emacser, a mechanical keyboard enthusiast and a father.
Timothy
Comments
  • didnt updated domain - Cloudflare

    didnt updated domain - Cloudflare

    GoDNS works correctly on subdomains like "www" or "test". But it seems to be that only subdomains got updated. Domains like "example.com" got ignored. (Only tested by using Cloudflare)

  • DNSPod无法更新解析

    DNSPod无法更新解析

    你好,进程启动后DNSPOD无法更新A记录 请帮忙看看是哪里问题呢?非常感谢! 【GoDNS】2018/07/31 15:00:22 debug: 0 www 【GoDNS】2018/07/31 15:00:22 get_subdomain:status code: 10001 【GoDNS】2018/07/31 15:00:22 domain: www.pipiv.com subDomainID: ip: 【GoDNS】2018/07/31 15:00:22 debug: 0 test 【GoDNS】2018/07/31 15:00:22 get_subdomain:status code: 10001 【GoDNS】2018/07/31 15:00:22 domain: test.pipiv.com subDomainID: ip: 【GoDNS】2018/07/31 15:00:22 Going to sleep, will start next checking in 5 minutes... 【GoDNS】2018/07/31 15:05:22 Checking IP for domain pipiv.com 【GoDNS】2018/07/31 15:05:22 get_domain:status code: 10001 【GoDNS】2018/07/31 15:05:23 currentIP is: 47.52.71.33

    【GoDNS】2018/07/31 15:05:23 debug: 0 www 【GoDNS】2018/07/31 15:05:23 get_subdomain:status code: 10001 【GoDNS】2018/07/31 15:05:23 domain: www.pipiv.com subDomainID: ip: 【GoDNS】2018/07/31 15:05:23 debug: 0 test 【GoDNS】2018/07/31 15:05:23 get_subdomain:status code: 10001 【GoDNS】2018/07/31 15:05:23 domain: test.pipiv.com subDomainID: ip: 【GoDNS】2018/07/31 15:05:23 Going to sleep, will start next checking in 5 minutes... 【GoDNS】2018/07/31 15:10:23 Checking IP for domain pipiv.com 【GoDNS】2018/07/31 15:10:23 get_domain:status code: 10001 【GoDNS】2018/07/31 15:10:25 currentIP is: 47.52.71.33

  • The strange NXDOMAIN info given by godns.

    The strange NXDOMAIN info given by godns.

    I use godns from one of the intranet machine running Ubuntu 20.04 to update the IP address on my router to the remote DDNS server. I noticed the following info:

    [GoDNS] 2021/01/27 08:37:59 GoDNS started, entering main loop...
    [GoDNS] 2021/01/27 08:37:59 Creating DNS handler with provider: DNSPod
    [GoDNS] 2021/01/27 08:37:59 Checking IP for domain hyddns.xyz 
    [GoDNS] 2021/01/27 08:38:05 currentIP is: 106.9.179.116
    [GoDNS] 2021/01/27 08:38:06 NXDOMAIN
    [GoDNS] 2021/01/27 08:38:06 IP is the same as cached one. Skip update.
    [GoDNS] 2021/01/27 08:38:06 Going to sleep, will start next checking in 30 seconds...
    

    My domain is hyddns.xyz, but godns will give the info of NXDOMAIN. OTOH, I also tested with dig as shown below on my domain:

    $ dig hyddns.xyz -t NS 
    
    ; <<>> DiG 9.16.1-Ubuntu <<>> hyddns.xyz -t NS
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16567
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 65494
    ;; QUESTION SECTION:
    ;hyddns.xyz.			IN	NS
    
    ;; ANSWER SECTION:
    hyddns.xyz.		21589	IN	NS	donald.dnspod.net.
    hyddns.xyz.		21589	IN	NS	myrtle.dnspod.net.
    
    ;; Query time: 72 msec
    ;; SERVER: 127.0.0.53#53(127.0.0.53)
    ;; WHEN: Wed Jan 27 08:45:01 CST 2021
    ;; MSG SIZE  rcvd: 91
    

    So, I'm very confused why godns gives NXDOMAIN message. Any hints will be highly appreciated.

    Regards, HY

  • Notify on Amazon SES not working

    Notify on Amazon SES not working

    Hi! First let me thank you for this awesome tool!

    I'm trying to enable email notifications on IP changes on Cloudflare, the IP is being correctly updated, I'm running GoDNS as a systemd service on Debian Stretch with an unprivileged dedicated user named "godns". Here's my config.json:

    {
      "provider": "Cloudflare",
      "email": "[email protected]",
      "password": "password",
      "domains": [
        {
          "domain_name": "domain.com",
          "sub_domains": ["subdomain"]
        }
      ],
      "ip_url": "https://icanhazip.com/",
      "ip_interface": "eth0",
      "socks5_proxy": "",
      "notify": {
        "enabled": true,
        "smtp_server": "email-smtp.us-east-1.amazonaws.com",
        "smtp_username": "username",
        "smtp_password": "password",
        "smtp_port": 587,
        "send_to": "[email protected]"
      }
    }
    

    I've tried port 25 too but it didn't work. Thanks in advance for any help!

  • Google DNS not working - potentially need to set user agent string

    Google DNS not working - potentially need to set user agent string

    godns 1.9.1 doesn't seem to successfully update my ddns with Google. The messaging looks successful:

    C:\Users\jeff\Desktop\GoDNS>godns.exe
    [GoDNS] 2019/08/30 18:46:20 GoDNS started, entering main loop...
    [GoDNS] 2019/08/30 18:46:20 Creating DNS handler with provider: Google
    [GoDNS] 2019/08/30 18:46:21 currentIP is: [censored]
    [GoDNS] 2019/08/30 18:46:21 Going to sleep, will start next checking in 300 seconds...
    

    however, checking Google Domains, the last update for my DNS was stated to be months ago.

    To check, I made the request directly via a browser to the end point using the same config/username/password/domain, and this successfully updated my ddns IP. https://CENSORED:[email protected]/nic/update?hostname=CENSORED.net&myip=CENSORED

    I noticed that UpdateIP() in the Google handler does not set a user agent when sending the request to the Google API endpoint. Per Google's API documentation, you should set a user agent when updating DNS: "Note: You must set a user agent in your request as well. Web browsers will generally add this for you when testing via the above url."

    Note the user agent might be required for other services as well, as it is one of the few things public API endpoints can use to ban "bad" bots who improperly use APIs without actually banning specific IPs directly - not saying this is the case here, but just noting in general.

    Edit: is there a way I can set user agent via the configuration?

  • DNSPOD限制每小时3600个请求,导致系统无法使用了

    DNSPOD限制每小时3600个请求,导致系统无法使用了

    Describe the bug
    A clear and concise description of what the bug is.

    The frequency of this issue

    • [ ] This issue is easy to reproduce.
    • [ ] This issue is not easy to reproduce.

    Steps to Reproduce
    Steps to reproduce the behavior.

    Your GoDNS configuration
    Past your GoDNS configuration here, please remember to remove the sensitive information.

    Expected behavior
    A clear and concise description of what you expected to happen.

    Screenshots
    If applicable, add screenshots to help explain your problem.

    Environment (please complete the following information):

    • DNS Provider: [e.g. Cloudflare]
    • OS: [e.g. Linux]

    Additional context
    Add any other context about the problem here.

  • 错误level=error msg=

    错误level=error msg="failed to get online IP:403"

    执行后日志有一下错误提示 time="2022-07-03T02:17:28Z" level=error msg="get ip online failed. Fallback to get ip from interface if possible.", time="2022-07-03T02:17:28Z" level=error msg="failed to get online IP:403" 如果把改 "ip_url": "https://ip.3322.net", 那么日志显示time="2022-07-03T03:36:05Z" level=error msg="empty result"

  • Configure GoDNS Docker container via environment variables

    Configure GoDNS Docker container via environment variables

    I'm interested in being able to configure my Docker-deployed instance of GoDNS with just environment variables. This way I don't have to create a new image containing my config file. I can think of three ways to do this:

    1. Add a CLI that has feature parity with the config file. This could be done like Traefik does it, using CLI flags with a dot syntax that is parsed to build the configuration object.
    2. Add a simplified CLI that supports only a basic case such as one provider and one domain.
    3. Add templating to the config file, and provide a simple default config file inside the Docker image that's set up to accept a few environment variables. Something like:
      // godns-config.json
      {
        "provider": "{{ .GODNS_PROVDER_NAME }}",
        "login_token": "{{ .GODNS_PROVIDER_TOKEN }}",
        "domains": [
          {
            "domain_name": "{{ .GODNS_DOMAIN }}",
            "sub_domains": "{{ .GODNS_SUBDOMAINS }}"
          }
        ],
        "ip_url": "{{ .GODNS_IP_RESOLVER_URL }}",
        "ip_type": "{{ .GODNS_IP_TYPE }} ",
        "interval": "{{ .GODNS_INTERVAL }}",
        "resolver": "{{ .GODNS_DNS_RESOLVER_IP }}",
        "debug_info": "{{ .GODNS_DEBUG }}"
      }
      

    Of these, I like option 3 the most. Option 1 is cool, but is also complicated. Option 2 feels like it could become a dead-end. Option 3 extends what already exists.

    I'm interested to know your thoughts, does this sound like a good direction and solution? If this does sound good then I'll plan to get started sometime soon.

  • Switch to distroless image (instead of alpine)

    Switch to distroless image (instead of alpine)

    Google provides distroless images even with no binaries at all for static linked binaries (easy for golang). There is no shell inside to it's improving security while all configuration files for linux are still there.

    see https://github.com/GoogleContainerTools/distroless

    Example: https://github.com/webdevops/pagerduty-exporter/blob/main/Dockerfile

  • Invalid request headers - Cloudflare

    Invalid request headers - Cloudflare

    Hi there,

    I'm running the app in docker.

    docker version                                                         ─╯
    Client:
     Version:           18.09.9
     API version:       1.39
     Go version:        go1.13.4
     Git commit:        1752eb3
     Built:             Sat Nov 16 01:05:26 2019
     OS/Arch:           linux/amd64
     Experimental:      false
    
    Server:
     Engine:
      Version:          18.09.9
      API version:      1.39 (minimum version 1.12)
      Go version:       go1.13.4
      Git commit:       9552f2b
      Built:            Sat Nov 16 01:07:48 2019
      OS/Arch:          linux/amd64
      Experimental:     false
    

    Using the following docker-compose file:

    ---
    version: "2"
    services:
      godns:
        image: timothyye/godns
        container_name: godns
        volumes:
          - /home/dustin/docker/godns/config.json:/usr/local/godns/config.json
        restart: unless-stopped
    

    My godns config file looks like:

    cat config.json                                                        ─╯
    {
        "provider": "Cloudflare",
        "email": "[email protected]",
        "password": "xxxxxxxxxxx",
        "domains": [
            {
                "domain_name": "xxxxxxxx.com",
                "sub_domains": [
                    "xxxxx"
                ]
            }
        ],
        "ip_url": "https://myip.biturl.top",
        "interval": 300,
        "socks5_proxy": ""
    }
    

    After starting with docker-compose -d up I then have a look at the logs with docker logs --tail 50 --follow --timestamps godns. I then see the following error:

    2020-01-03T22:45:04.007390136Z [GoDNS] 2020/01/03 22:45:04 Response failed: {"success":false,"errors":[{"code":6003,"message":"Invalid request headers","error_chain":[{"code":6103,"message":"Invalid format for X-Auth-Key header"}]}],"messages":[],"result":null}
    

    Any suggestions?

    EDIT PS Thank you!

  • Please add Type check about subdomain in config

    Please add Type check about subdomain in config

    Please add Type check about subdomain in config

    I have 2 record,

    • PC.example.com. A 127.0.0.1

    • PC.example.com,AAAA fe80::1111

    If I write like this,The program will change 2 records in the same time. { "domains": [ { "domain_name": "example.com", "sub_domains": [ "PC" ] } ] }

    If I want modify AAAA record only,it seems impossible.

    I think the best solution is add Type definition in configuration.

  • Feature request: Support OVH provider

    Feature request: Support OVH provider

    It would be cool to support OVH too as a dynamic DNS provider. I'm not an expert at all but I think it's possible since other tools specifically made for OVH exist on GitHub.

  • Config compatibility issue:

    Config compatibility issue: "ip_url" in old config vs. "ip_urls" in new config

    Describe the bug
    In older configs ip_url was a single item. In newer configs, it is now an array and called ip_urls. When upgrading go_dns to a new version, the ip_url seems to be ignored, leading to guessing the public ip, and not updating anything. Even the debug log does not contain any information about silently failing (log from v2.8.9)

    INFO[0000] GoDNS started, entering main loop...
    INFO[0000] Creating DNS handler with provider: Cloudflare
    DEBU[0000] IP () matches cached IP (), skipping
    

    The frequency of this issue

    • [*] This issue is easy to reproduce.

    Steps to Reproduce
    Get v2.7.1 and v2.8.9

    Create a config.json with the following line:

    ...
      "ip_url": "https://api.ipify.org",
    ...
    

    The old version will work as expected, producing a log something like this:

    INFO[0000] GoDNS started, entering main loop...
    INFO[0000] Creating DNS handler with provider:Cloudflare
    INFO[0000] Checking IP for domain x.com
    INFO[0001] Querying records with type:A
     NFO[0001] IP mismatch: Current(xxx) vs Cloudflare(xxx)
    INFO[0001] Record updated: x.com - xxx
    

    The new version will ignore ip_url and will produce the log as above.

    Expected behavior
    The new version should either

    • [PREFERRED] work as expected and be backward compatible
    • [NOT PREFERRED] fail, saying it is now called ip_urls and should be an array

    Environment (please complete the following information):

    • DNS Provider: Cloudflare
    • OS: linux
  • Problem managing Linode-based domain names.

    Problem managing Linode-based domain names.

    Describe the bug
    A clear and concise description of what the bug is.

    I had GoDNS running already on a number of domains; I added a couple and changed my godns.json around, and upon re-launching my domain DNS remains blank.

    The frequency of this issue
    could be a local issue.

    Steps to Reproduce

    sudo systemctl restart godns
    # or
    godns -c ~/src/godns/godns.json
    

    Your GoDNS configuration

    {
      "provider": "Linode",
      "login_token": "abc123",
      "domains": [
        {
          "domain_name": "assembled.app",
          "sub_domains": ["*", "@"]
        },
        {
          "domain_name": "base.bingo",
          "sub_domains": ["@"]
        },
        {
          "domain_name": "aerial.bio",
          "sub_domains": ["@"]
        },
        {
          "domain_name": "library.cards",
          "sub_domains": ["@"]
        },
        {
          "domain_name": "silicon.am",
          "sub_domains": ["@"]
        }
      ],
      "resolver": "8.8.8.8",
      "ip_url": "https://api.ipify.org",
      "ipv6_url": "https://ipify.org",
      "ip_type": "IPv4",
      "interval": 300
    }
    

    Expected behavior
    Linode DNS records should be added.

    Screenshots
    image

    Environment (please complete the following information):

    • DNS Provider: Linode
    • OS: on Raspberry Pi 4 / Arm64 / Ubuntu 22.04

    Additional context

    GoDNS systemd logs:

    ● godns.service - GoDNS Pong
         Loaded: loaded (/lib/systemd/system/godns.service; enabled; vendor preset: enabled)
         Active: active (running) since Tue 2022-09-13 05:13:29 EDT; 9h ago
       Main PID: 2161 (godns)
          Tasks: 7 (limit: 1788)
         Memory: 1.8M
            CPU: 185ms
         CGroup: /system.slice/godns.service
                 └─2161 /home/access/bin/godns -c=/home/access/src/godns/godns.json
    
    Sep 13 05:13:29 genkan systemd[1]: Started GoDNS Pong.
    Sep 13 05:13:29 genkan godns[2161]: time="2022-09-13T05:13:29-04:00" level=info msg="GoDNS started, entering main loop..."
    Sep 13 05:13:29 genkan godns[2161]: time="2022-09-13T05:13:29-04:00" level=info msg="Creating DNS handler with provider: Linode"
    

    My /lib/systemd/system/godns.service:

    [Unit]
    Description=GoDNS Pong
    After=network.target
    
    [Service]
    ExecStart=/home/access/bin/godns -c=/home/me/src/godns/godns.json
    Restart=always
    KillMode=process
    RestartSec=2s
    
    [Install]
    WantedBy=multi-user.target
    

    I can access IP address on my machine:

    $ curl https://api.ipify.org
    98.218.220.151
    
  • Idea: run as a Caddy plugin

    Idea: run as a Caddy plugin

    Hello @TimothyYe - I am experiencing good success using GoDNS on my home machines, combined alongside Dokku managing my programs' pods.

    I am curious - perhaps I could decrease my dependencies by using GoDNS alongside Caddy; such as inside a Caddy plugin: https://caddyserver.com/docs/extending-caddy

    Dynamic DNS seems like an incredible leg up many Caddy programmers could use. You could read a domain name based on a Caddyfile, and manage necessary DNS records based on your phenomenal API code colleccion.

Godaddy-domains-client-go - Godaddy domains api Client golang - Write automaticly from swagger codegen

Go API client for swagger Overview This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you c

Jan 9, 2022
Self-hosted and Easy-to-deploy Cloudflare based Dynamic DNS service for router
Self-hosted and Easy-to-deploy Cloudflare based Dynamic DNS service for router

Self-hosted and Easy-to-deploy Cloudflare based Dynamic DNS service for router Contents Features Environment Variables Installation Heroku Docker (Run

Oct 9, 2022
Hetzner-dns-updater - A simple tool to update a DNS record via Hetzner DNS API. Used for simple HA together with Nomad

hetzner-dns-updater A small utility tool to update a single record via Hetzner D

Feb 12, 2022
A simple tool to detect WAN IP changes and updates your cloudflare DNS entries.

Cloudflare IP Updater A simple tool to detect WAN IP changes and updates your cloudflare DNS entries. Usage Create a new Cloudflare API token Copy the

Dec 1, 2022
dynflare is a tool to automatically update dns records at Cloudflare, when the ip changes.

dynflare dynflare is a tool to automatically update dns records at Cloudflare, when the ip changes. How it works The current ips are determined by ask

Dec 7, 2021
Automatically register a list of domain names, add them to Cloudflare and set DNS records.

NameCannon Automatically register a list of domain names, add them as zones on Cloudflare, then add DNS records. Usage $ ./NameCannon --namesiloSecret

Jan 26, 2022
Updating DNS records for dynamically changing IPs via the Cloudflare API

Cloudflare Dynamic IP Server About The Project About The Project Updating DNS re

Dec 24, 2021
Get related domains / subdomains by looking at Google Analytics IDs
Get related domains / subdomains by looking at Google Analytics IDs

AnalyticsRelationships This script try to get related domains / subdomains by looking at Google Analytics IDs from a URL. First search for ID of Googl

Jan 2, 2023
Dynamic dns for name.com

name-ddns Dynamic DNS for Name.com using v4 name.com API Usage docker run --rm \ -e "NAME_DDNS_USER=namecom-user" \ -e "NAME_DDNS_TOKEN=namecom-toke

Aug 17, 2022
Go package to simulate bandwidth, latency and packet loss for net.PacketConn and net.Conn interfaces

lossy Go package to simulate bandwidth, latency and packet loss for net.PacketConn and net.Conn interfaces. Its main usage is to test robustness of ap

Oct 14, 2022
Sep 23, 2022
DNS Ping: to check packet loss and latency issues with DNS servers

DNSping DNS Ping checks packet loss and latency issues with DNS servers Installation If you have golang, easiest install is go get -u fortio.org/dnspi

Nov 18, 2022
Verify IP addresses of respectful crawlers like Googlebot by reverse dns and forward dns lookups
Verify IP addresses of respectful crawlers like Googlebot by reverse dns and forward dns lookups

goodbots - trust but verify goodbots verifies the IP addresses of respectful crawlers like Googlebot by performing reverse dns and forward dns lookups

Aug 16, 2022
netcup DNS module for caddy: dns.providers.netcup

netcup DNS module for Caddy This package contains a DNS provider module for Caddy. It can be used to manage DNS records with the netcup DNS API using

Nov 9, 2022
A fork on miekg/dns (since I've already forked zmap/dns)

Alternative (more granular) approach to a DNS library Less is more. Complete and usable DNS library. All Resource Records are supported, including the

Jan 19, 2022
A simple DNS forwarder that forwards DNS queries to various upstreams

A simple DNS forwarder that forwards DNS queries to various upstreams. If an upstream returns NXDomain, the next upstream is tried.

Jul 8, 2022
Given a list of domains, you resolve them and get the IP addresses.
Given a list of domains, you resolve them and get the IP addresses.

resolveDomains Given a list of domains, you resolve them and get the IP addresses. Installation If you want to make modifications locally and compile

Oct 19, 2022
Coredns plugin for relaying .local domains

CoreDNS Local_Query This is a plugin for coredns that was developed to allow for the use of naked hosts in place of .local domains i.e example.local b

Nov 4, 2021
TLDs finder: check domain name availability across all valid top-level domains

TLD:er TLDs finder — check domain name availability across all valid top-level d

Oct 31, 2022