Simple and easy to use DDNS. Support Aliyun, Tencent Cloud, Dnspod, Cloudflare, Callback, Huawei Cloud, Baidu Cloud, Porkbun, GoDaddy, Namecheap, NameSilo...
Go to file
PairZhu 7befe6e7da
refactor: 重构前端代码 (#988)
* refactor: 重构前端代码

几乎完全重构前端js代码
小幅度重构后端代码(主要为了适配前端)

* fix: 修复主题色无法自适应的bug

还原了主题色修改函数的write参数,去除该参数会导致自适应修改主题时也会写入localStorage

* feat: 自动修改标签的for属性

自动修改”获取 IP 方式“标签的for属性,保证其始终指向当前可编辑的元素

* refactor: 去除JQuery

* refactor: 按业务划分代码

* fix: 对空值兼容

* fix: 统一html命名

* feat: 默认选择最后一个配置

* fix: 删除冗余代码

* fix: Update writing.html
2024-01-22 04:34:46 -08:00
.github feat: remove ivaquero/chinese/ddns-go (#943) 2023-12-19 11:00:31 +08:00
.vscode new 2020-08-26 23:56:01 +08:00
config refactor: 重构前端代码 (#988) 2024-01-22 04:34:46 -08:00
dns feat(cloudflare): support comment param (#980) 2024-01-14 04:29:12 -08:00
static refactor: 重构前端代码 (#988) 2024-01-22 04:34:46 -08:00
util refactor: 重构前端代码 (#988) 2024-01-22 04:34:46 -08:00
web refactor: 重构前端代码 (#988) 2024-01-22 04:34:46 -08:00
.editorconfig 增加 Makefile 优化编译脚本,并添加相应的说明 (#19) 2020-12-25 10:50:01 +08:00
.gitignore 增加 Makefile 优化编译脚本,并添加相应的说明 (#19) 2020-12-25 10:50:01 +08:00
.goreleaser.yml fix: goreleaser deprecates --rm-dist and archives.replacements (#514) 2023-02-03 12:28:40 +08:00
ddns-web.png feat: support english (#967) 2024-01-11 15:52:53 +08:00
Dockerfile revert: golang 1.20 (#977) 2024-01-12 05:15:58 -08:00
favicon.ico feat: using golang1.16 embed (#40) 2021-02-23 18:15:45 +08:00
go.mod revert: golang 1.20 (#977) 2024-01-12 05:15:58 -08:00
go.sum feat: support english (#967) 2024-01-11 15:52:53 +08:00
LICENSE Add LICENSE 2020-08-31 17:06:54 +08:00
main.go refactor: 重构前端代码 (#988) 2024-01-22 04:34:46 -08:00
Makefile chore: get HEAD commit when version is missing tag (#777) 2023-07-20 21:45:23 +08:00
README_EN.md docs: Make docs more beautiful (#975) 2024-01-12 13:37:31 +08:00
README.md docs: Make docs more beautiful (#975) 2024-01-12 13:37:31 +08:00

ddns-go

GitHub release GitHub release downloads Go version

中文 | English

Automatically obtain your public IPv4 or IPv6 address and resolve it to the corresponding domain name service.

Features

  • Support Mac, Windows, Linux system, support ARM, x86 architecture
  • Support domain service providers Aliyun Tencent Dnspod Cloudflare Huawei Callback Baidu Porkbun GoDaddy Google Domain Namecheap NameSilo
  • Support interface / netcard / command to get IP
  • Support running as a service
  • Default interval is 5 minutes
  • Support configuring multiple DNS service providers at the same time
  • Support multiple domain name resolution at the same time
  • Support multi-level domain name
  • Configured on the web page, simple and convenient
  • In the web page, you can quickly view the latest 50 logs
  • Support Webhook notification
  • Support TTL

Note

If you enable public network access, it is recommended to use Nginx and other reverse proxy software to enable HTTPS access to ensure security.

Use in system

  • Download and unzip ddns-go from Releases

  • Run in service mode

    • Mac/Linux: sudo ./ddns-go -s install
    • Win(Run as administrator): .\ddns-go.exe -s install
  • [Optional] Uninstall service

    • Mac/Linux: sudo ./ddns-go -s uninstall
    • Win(Run as administrator): .\ddns-go.exe -s uninstall
  • [Optional] Support installation with parameters

    • -l listen address
    • -f sync frequency(seconds)
    • -cacheTimes interval N times compared with service providers
    • -c custom configuration file path
    • -noweb does not start web service
    • -skipVerify skip certificate verification
    • -dns custom DNS server
  • [Optional] Examples

    • 10 minutes to synchronize once, and the configuration file address is specified
      ./ddns-go -s install -f 600 -c /Users/name/.ddns_go_config.yaml
      
    • Every 10 seconds to check the local IP changes, every 30 minutes to compare the IP changes, to achieve IP changes immediately trigger updates and will not be limited by the service providers, if the use of api to obtain IP, need to pay attention to the api side of the flow limit
      ./ddns-go -s install -f 10 -cacheTimes 180
      
  • [Optional] You can use Homebrew to install ddns-go

    brew install ddns-go
    

Use in docker

  • Mount the host directory, use the docker host mode. You can replace /opt/ddns-go with any directory on your host, the configuration file is a hidden file

    docker run -d --name ddns-go --restart=always --net=host -v /opt/ddns-go:/root jeessy/ddns-go
    
  • Open http://DOCKER_IP:9876 in the browser, modify your configuration

  • [Optional] Use ghcr.io mirror

    docker run -d --name ddns-go --restart=always --net=host -v /opt/ddns-go:/root ghcr.io/jeessy2/ddns-go
    
  • [Optional] Support startup with parameters -llisten address -fSync frequency(seconds)

    docker run -d --name ddns-go --restart=always --net=host -v /opt/ddns-go:/root jeessy/ddns-go -l :9877 -f 600
    
  • [Optional] Without using docker host mode

    docker run -d --name ddns-go --restart=always -p 9876:9876 -v /opt/ddns-go:/root jeessy/ddns-go
    

Webhook

  • Support webhook, when the domain name is updated successfully or not, the URL filled in will be called back

  • Support variables

    Variable name Comments
    #{ipv4Addr} The new IPv4
    #{ipv4Result} IPv4 update result: no changed success failed
    #{ipv4Domains} IPv4 domainsSplit by ,
    #{ipv6Addr} The new IPv6
    #{ipv6Result} IPv6 update result: no changed success failed
    #{ipv6Domains} IPv6 domainsSplit by ,
  • If RequestBody is empty, it is a GET request, otherwise it is a POST request

  • Telegram

    ddns-telegram-bot

  • Discord
    • Discord client -> Server -> Channel Settings -> Integration -> View Webhook -> New Webhook -> Copy Webhook URL
    • Input the Webhook URL copied from Discord in the URL
    • Input in RequestBody
      {
          "content": "The domain name #{ipv4Domains} dynamically resolves to #{ipv4Result}.",
          "embeds": [
              {
                  "description": "Domains: #{ipv4Domains}, Result: #{ipv4Result}, IP: #{ipv4Addr}",
                  "color": 15258703,
                  "author": {
                      "name": "DDNS"
                  },
                  "footer": {
                      "text": "DDNS #{ipv4Result}"
                  }
              }
          ]
      }
      
  • More webhook configuration reference

Callback

  • Support more third-party DNS service providers through custom callback
  • Callback will be called as many times as there are lines in the configured domain name
  • Support variables
    Variable name Comments
    #{ip} The new IPv4/IPv6 address
    #{domain} Current domain
    #{recordType} Record type A or AAAA
    #{ttl} TTL
  • If RequestBody is empty, it is a GET request, otherwise it is a POST request

Web interfaces

screenshots