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 998a01a2a8
fix terrible logic 😳
3 days ago
deployment refactoring dns resolver so that hosts file entries dont clobber 3 weeks ago
.gitignore fixing bugs found at layerze.ro setup 5 months ago
Dockerfile first working version 12 months ago
ReadMe.md refactoring dns resolver so that hosts file entries dont clobber 3 weeks ago
build-docker.sh first working version 12 months ago
config.go refactor constantlyMonitorDomains() away from the main loop 3 months ago
config.json first working version 12 months ago
dns_echo_ip_service.go first working version 12 months ago
gandi_service.go first working version 12 months ago
go.mod refactoring dns resolver so that hosts file entries dont clobber 3 weeks ago
go.sum refactoring dns resolver so that hosts file entries dont clobber 3 weeks ago
http_plaintext_ip_service.go first working version 12 months ago
ip_api_dot_com_service.go first working version 12 months ago
libp2p_self_ip.go first working version 12 months ago
main.go fix terrible logic 😳 3 days 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

{
  "PingPongLog": false,
  "GandiRecordTTLSeconds": 300,
  "HealthPollingSeconds": 20,
  "ResetAfterConsecutiveFailures": 3,
  "GandiAPIKey": "****************",
  "DNSResolvers": [
    "8.8.8.8:53",
    "9.9.9.9:53",
    "1.1.1.1:53"
  ],
  "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

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