mirror of
https://github.com/anaganisk/digitalocean-dynamic-dns-ip.git
synced 2024-08-30 17:42:10 +00:00
Merge pull request #20 from anaganisk/changeDefaultIpApi
change referencess to IP lookup APIs to working services
This commit is contained in:
commit
b2bf3dff44
2
.github/workflows/go.yml
vendored
2
.github/workflows/go.yml
vendored
@ -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: |
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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": [
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user