dynamic-ish DNS for gandi and porkbun [ no namecheap support until namecheap opens up thier API!! >:( ]
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 2722152ebd Merge pull request 'porkbun-support' (#1) from porkbun-support into main 4 months ago
deployment refactoring dns resolver so that hosts file entries dont clobber 1 year ago
.gitignore fixing bugs found at layerze.ro setup 2 years ago
Dockerfile first working version 2 years ago
ReadMe.md udpdate example config on readme 4 months ago
build-docker.sh refactor to allow for multiple registrar accounts 4 months ago
config.go udpdate example config on readme 4 months ago
config.json refactor to allow for multiple registrar accounts 4 months ago
dns_echo_ip_service.go first working version 2 years ago
gandi_service.go refactor to allow for multiple registrar accounts 4 months ago
go.mod refactoring dns resolver so that hosts file entries dont clobber 1 year ago
go.sum refactoring dns resolver so that hosts file entries dont clobber 1 year ago
http_plaintext_ip_service.go first working version 2 years ago
ip_api_dot_com_service.go first working version 2 years ago
libp2p_self_ip.go first working version 2 years ago
main.go udpdate example config on readme 4 months ago
porkbun_service.go docs link 4 months 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,
  "HealthPollingSeconds": 20,
  "ResetAfterConsecutiveFailures": 3,
  "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"
        }
      ]
    },
    {
      "RegistrarAccountLabel": "sequentialread-gandi", 
      "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