Mirror of https://git.sequentialread.com/forest/gandi-dns-updater dynamic dns ipv4 ipv6 gandi porkbun
Find a file
2024-07-27 18:21:49 -05:00
deployment refactoring dns resolver so that hosts file entries dont clobber 2023-01-06 18:10:57 -06:00
.gitignore fixing bugs found at layerze.ro setup 2022-08-26 22:53:36 -05:00
build-docker.sh refactor to allow for multiple registrar accounts 2024-02-24 18:32:39 -06:00
config.go IPv6 Support is working 2024-07-27 17:05:42 -05:00
config.json refactor to allow for multiple registrar accounts 2024-02-24 18:32:39 -06:00
dns_echo_ip_service.go IPv6 Support is working 2024-07-27 17:05:42 -05:00
dns_resolver.go IPv6 Support is working 2024-07-27 17:05:42 -05:00
Dockerfile first working version 2022-02-13 22:58:31 -06:00
gandi_service.go fixing bugs related to ipv6 changes 2024-07-27 18:21:49 -05:00
go.mod IPv6 Support is working 2024-07-27 17:05:42 -05:00
go.sum IPv6 Support is working 2024-07-27 17:05:42 -05:00
http_plaintext_ip_service.go IPv6 Support is working 2024-07-27 17:05:42 -05:00
ip6_dot_me_service.go IPv6 Support is working 2024-07-27 17:05:42 -05:00
libp2p_self_ip.go first working version 2022-02-13 22:58:31 -06:00
main.go fixing bugs related to ipv6 changes 2024-07-27 18:21:49 -05:00
my_ipv6_address_dotcom_service.go IPv6 Support is working 2024-07-27 17:05:42 -05:00
porkbun_service.go IPv6 Support is working 2024-07-27 17:05:42 -05:00
ReadMe.md IPv6 Support is working 2024-07-27 17:05:42 -05:00

Gandi DNS Updater

Uses Gandi's LiveDNS API to keep my A records up to date when CenturyLink changes my home IP address.

It polls intelligently: It spams YOUR domains that you configure to determine if everything is ok. Only when your stuff goes down does it start talking to gandi. Once it gets the current list of resource records for a domain does it then proceed to determine its public IP and attempt to update the records.

It uses a consensus of over 50% of the following 3rd party services in order to determine its current public IP:

  • myipv6address.com
  • ip6.me/api
  • icanhazip.com
  • getmyip.dev
  • ipify.org
  • myip.opendns.com
  • o-o.myaddr.l.google.com

Example Config

{
  "PingPongLog": false,
  "HealthPollingSeconds": 20,
  "ResetAfterConsecutiveFailures": 3,
  "IPv6Enabled": true,
  "DNSResolvers": [
    "8.8.8.8:53",
    "9.9.9.9:53",
    "1.1.1.1:53"
  ],
  "RegistrarAccounts": [
    {
      "Label": "sequentialread-gandi",
      "Provider": "gandi",
      "SecretKey" : "*****************",
      "RecordTTLSeconds": 300
    }
  ]
  "Domains": [
    {
      "RegistrarAccountLabel": "sequentialread-gandi", 
      "Domain": "sequentialread.com",
      "Records": [
        {
          "Name": "@",
          "Type": "A"
        },
        {
          "Name": "*",
          "Type": "A"
        },
        {
          "Name": "@",
          "Type": "AAAA"
        },
        {
          "Name": "*",
          "Type": "AAAA"
        }
      ]
    },
    {
      "RegistrarAccountLabel": "sequentialread-gandi", 
      "Domain": "server.garden",
      "Records": [
        {
          "Name": "@",
          "Type": "A"
        },
        {
          "Name": "www",
          "Type": "A"
        },
        {
          "Name": "@",
          "Type": "AAAA"
        },
        {
          "Name": "www",
          "Type": "AAAA"
        }
      ]
    }
  ]
}

or

    environment:
      - GDU_IPV6ENABLED=true
      - GDU_REGISTRARACCOUNTS_0_LABEL=sequentialread-gandi
      - GDU_REGISTRARACCOUNTS_0_PROVIDER=gandi
      - GDU_REGISTRARACCOUNTS_0_SECRETKEY=${GREENHOUSE_GANDI_API_KEY}
      - GDU_REGISTRARACCOUNTS_0_RECORDTTLSECONDS=300
      - GDU_DOMAINS_0_REGISTRARACCOUNTLABEL=sequentialread-gandi
      - GDU_DOMAINS_0_DOMAIN=sequentialread.com
      - GDU_DOMAINS_0_RECORDS_0_NAME=@
      - GDU_DOMAINS_0_RECORDS_0_TYPE=A
      - GDU_DOMAINS_0_RECORDS_1_NAME=*
      - GDU_DOMAINS_0_RECORDS_1_TYPE=A
      - GDU_DOMAINS_0_RECORDS_2_NAME=@
      - GDU_DOMAINS_0_RECORDS_2_TYPE=AAAA
      - GDU_DOMAINS_0_RECORDS_3_NAME=*
      - GDU_DOMAINS_0_RECORDS_4_TYPE=AAAA
      - GDU_DOMAINS_1_REGISTRARACCOUNTLABEL=sequentialread-gandi
      - GDU_DOMAINS_1_DOMAIN=server.garden
      - GDU_DOMAINS_1_RECORDS_0_NAME=@
      - GDU_DOMAINS_1_RECORDS_0_TYPE=A
      - GDU_DOMAINS_1_RECORDS_1_NAME=www
      - GDU_DOMAINS_1_RECORDS_1_TYPE=A
      - GDU_DOMAINS_1_RECORDS_2_NAME=@
      - GDU_DOMAINS_1_RECORDS_2_TYPE=AAAA
      - GDU_DOMAINS_1_RECORDS_3_NAME=www
      - GDU_DOMAINS_1_RECORDS_3_TYPE=AAAA

layerze.ro deployment

Build the app & webclip the build:

$ GOARCH=arm64 go build -o gandi-dns-updater .
$ curl https://webclip.sequentialread.com/gandi-dns-updater | bash

Deploy the new binary from webclip:

sudo -i

cd /opt/gandi-dns-updater && service gandi-dns-updater stop && rm gandi-dns-updater && curl https://webclip.sequentialread.com > gandi-dns-updater && chmod +x gandi-dns-updater && service gandi-dns-updater start

OR

cd /opt/gandi-dns-updater && systemctl stop gandi-dns-updater && rm gandi-dns-updater && curl https://webclip.sequentialread.com > gandi-dns-updater && chmod +x gandi-dns-updater && systemctl start gandi-dns-updater