From 2eef63e3ebdbee4d49bef89ece8f8241b46b67a8 Mon Sep 17 00:00:00 2001 From: John Aylward Date: Thu, 11 Nov 2021 16:36:02 -0500 Subject: [PATCH] change refs to IP lookup APIs to working services --- .github/workflows/go.yml | 2 +- README.md | 6 +++--- digitalocean-dynamic-ip.go | 4 ++-- digitalocean-dynamic-ip.sample.json | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 4f38819..0877c3b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.11 + go-version: 1.17 - name: Build run: | diff --git a/README.md b/README.md index a875e75..577ceeb 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A simple script in Go language to automatically update Digital ocean DNS records if you have a dynamic IP. Since it can be compiled on any platform, you can use it along with raspberrypi etc. -To find your Dynamic IP, this program will call out to https://ipv4bot.whatismyipaddress.com for ipv4 addresses and https://ipv6bot.whatismyipaddress.com for ipv6 addresses. This is to support dual-stack environments. (These URLs can be customized; see Usage, below.) +To find your Dynamic IP, this program will call out to https://api.ipify.org/ for ipv4 addresses and https://api64.ipify.org/ for ipv6 addresses. This is to support dual-stack environments. (These URLs can be customized; see Usage, below.) ## Requirements @@ -37,7 +37,7 @@ Create a file `.digitalocean-dynamic-ip.json` (dot prefix to hide the file) and "useIPv4": true, "useIPv6": false, "allowIPv4InIPv6": false, - "ipv4CheckUrl": "https://ipv4bot.whatismyipaddress.com", + "ipv4CheckUrl": "https://api.ipify.org/?format=text", "domains": [ { "domain": "example.com", @@ -70,7 +70,7 @@ By default, the configuration checks both IPv4 and IPv6 addresses assuming your The `allowIPv4InIPv6` configuration option will allow adding an IPv4 address to be used in a AAAA record for IPv6 lookups. -The `ipv4CheckUrl` and `ipv6CheckUrl` configuration settings are optional. If set, they must be URLs which respond to a GET request, with a plaintext response containing only your IP address. If unset, they default to `https://ipv_bot.whatismyipaddress.com`. +The `ipv4CheckUrl` and `ipv6CheckUrl` configuration settings are optional. If set, they must be URLs which respond to a GET request, with a plaintext response containing only your IP address. If unset, they default to `https://api.ipify.org/?format=text` and `https://api64.ipify.org/?format=text` respectively. ```bash # after running `go build digitalocean-dynamic-ip.go`, run: diff --git a/digitalocean-dynamic-ip.go b/digitalocean-dynamic-ip.go index 8a698f1..23deb9a 100644 --- a/digitalocean-dynamic-ip.go +++ b/digitalocean-dynamic-ip.go @@ -122,8 +122,8 @@ func usage() { //CheckLocalIPs : get current IP of server. checks both IPv4 and Ipv6 to support dual stack environments func CheckLocalIPs() (ipv4, ipv6 net.IP) { var ipv4String, ipv6String string - ipv4CheckURL := "https://ipv4bot.whatismyipaddress.com" - ipv6CheckURL := "https://ipv6bot.whatismyipaddress.com" + ipv4CheckURL := "https://api.ipify.org/?format=text" + ipv6CheckURL := "https://api64.ipify.org/?format=text" if len(config.IPv4CheckURL) > 0 { ipv4CheckURL = config.IPv4CheckURL } diff --git a/digitalocean-dynamic-ip.sample.json b/digitalocean-dynamic-ip.sample.json index 43d7622..df9b471 100644 --- a/digitalocean-dynamic-ip.sample.json +++ b/digitalocean-dynamic-ip.sample.json @@ -3,8 +3,8 @@ "doPageSize": 20, "useIPv4": true, "useIPv6": true, - "ipv4CheckUrl": "https://ipv4bot.whatismyipaddress.com", - "ipv6CheckUrl": "https://ipv6bot.whatismyipaddress.com", + "ipv4CheckUrl": "https://api.ipify.org/?format=text", + "ipv6CheckUrl": "https://api64.ipify.org/?format=text", "allowIPv4InIPv6": false, "domains": [ {