dynamic-ish DNS for gandi
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
forest 5a24b97339 update readme 1 month ago
.gitignore fixing bugs found at layerze.ro setup 1 month ago
Dockerfile first working version 8 months ago
ReadMe.md update readme 1 month ago
build-docker.sh first working version 8 months ago
config.json first working version 8 months ago
dns_echo_ip_service.go first working version 8 months ago
gandi_service.go first working version 8 months ago
go.mod first working version 8 months ago
go.sum first working version 8 months ago
http_plaintext_ip_service.go first working version 8 months ago
ip_api_dot_com_service.go first working version 8 months ago
libp2p_self_ip.go first working version 8 months ago
main.go all good log 1 month ago

ReadMe.md

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:

  • j3s.sh/ip
  • ip-api.com
  • icanhazip.com
  • api.ipify.org
  • myip.opendns.com
  • whoami.akamai.net
  • o-o.myaddr.l.google.com

Example Config

{
  "GandiRecordTTLSeconds": 300,
  "HealthPollingSeconds": 10,
  "ResetAfterConsecutiveFailures": 10,
  "Domains": [
    {
      "Domain": "sequentialread.com",
      "Records": [
        {
          "Name": "@",
          "Type": "A"
        },
        {
          "Name": "*",
          "Type": "A"
        }
      ]
    },
    {
      "Domain": "server.garden",
      "Records": [
        {
          "Name": "@",
          "Type": "A"
        },
        {
          "Name": "www",
          "Type": "A"
        },
        {
          "Name": "greenhouse",
          "Type": "A"
        },
        {
          "Name": "www.greenhouse",
          "Type": "A"
        },
        {
          "Name": "telemetry.greenhouse-alpha",
          "Type": "A"
        }
      ]
      
    }
  ]
}

or

    environment:
      - GDU_GANDIAPIKEY=${GREENHOUSE_GANDI_API_KEY}
      - 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_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=greenhouse
      - GDU_DOMAINS_1_RECORDS_2_TYPE=A
      - GDU_DOMAINS_1_RECORDS_3_NAME=www.greenhouse
      - GDU_DOMAINS_1_RECORDS_3_TYPE=A
      - GDU_DOMAINS_1_RECORDS_4_NAME=telemetry.greenhouse-alpha
      - GDU_DOMAINS_1_RECORDS_4_TYPE=A

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