All Projects → anaganisk → digitalocean-dynamic-dns-ip

anaganisk / digitalocean-dynamic-dns-ip

Licence: other
A simple script to automatically update Digital ocean DNS records with dynamic IP

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to digitalocean-dynamic-dns-ip

External Dns
Configure external DNS servers (AWS Route53, Google CloudDNS and others) for Kubernetes Ingresses and Services
Stars: ✭ 4,749 (+5358.62%)
Mutual labels:  dns, dns-record
Digital Ocean Dynamic Dns Updater
Digital Ocean Dynamic DNS Updater
Stars: ✭ 223 (+156.32%)
Mutual labels:  dns, digitalocean
Lexicon
Manipulate DNS records on various DNS providers in a standardized way.
Stars: ✭ 1,028 (+1081.61%)
Mutual labels:  dns, digitalocean
DnsTube
Access your computer from anywhere. DnsTube is a Windows .NET dynamic DNS client for Cloudflare.
Stars: ✭ 137 (+57.47%)
Mutual labels:  dns, dns-record
Dns Tool
A set of browser-based DNS tools for DigitalOcean Community.
Stars: ✭ 50 (-42.53%)
Mutual labels:  dns, digitalocean
DNS
Swift implementation of DNS Records / RR
Stars: ✭ 51 (-41.38%)
Mutual labels:  dns, dns-record
HacktoberFest 2021
Hacktoberfest 2021 contribution repository✨
Stars: ✭ 43 (-50.57%)
Mutual labels:  digitalocean
desec-ns
Frontend nameserver for deSEC, implemented as docker-compose application
Stars: ✭ 22 (-74.71%)
Mutual labels:  dns
dns
DNS client & server package for Go
Stars: ✭ 38 (-56.32%)
Mutual labels:  dns
groot
Static verification tool for DNS zone files
Stars: ✭ 60 (-31.03%)
Mutual labels:  dns
Github-Profile-README
A list of GitHub Readme Profiles.
Stars: ✭ 15 (-82.76%)
Mutual labels:  digitalocean
BhimIntegers
BhimIntegers🚀 is a C++ library that is useful when we are dealing with BigIntegers💥💥. We can handle big integers (integers having a size bigger than the long long int data type) and we can perform arithmetic operations📘 like addition, multiplication, subtraction, division, equality check, etc📐📐. Also, there are several functions like factorial, …
Stars: ✭ 43 (-50.57%)
Mutual labels:  digitalocean
Code-Hub
No description or website provided.
Stars: ✭ 107 (+22.99%)
Mutual labels:  digitalocean
no-ip
Noip.com Dynamic DNS update client built in Node.js
Stars: ✭ 33 (-62.07%)
Mutual labels:  dns
MicroDNSSrv
A micro DNS server for MicroPython to simply respond to A queries on multi-domains with or without wildcards (used on Pycom modules & ESP32)
Stars: ✭ 43 (-50.57%)
Mutual labels:  dns
dnsfwd
DNS forwarder over a (TCP) virtual circuit
Stars: ✭ 21 (-75.86%)
Mutual labels:  dns
dns
dns is a simple CLI tool for DNS-LG API
Stars: ✭ 28 (-67.82%)
Mutual labels:  dns
dnspod-api-php-web
DNSPod API PHP Web Example
Stars: ✭ 88 (+1.15%)
Mutual labels:  dns
speedtest-for-digitalocean
Run speed tests for all DigitalOcean datacenters faster than ever.
Stars: ✭ 40 (-54.02%)
Mutual labels:  digitalocean
cfdns
Command line tool for manipulating DNS of CloudFlare hosted domains
Stars: ✭ 20 (-77.01%)
Mutual labels:  dns

DIGITAL OCEAN DYNAMIC IP API CLIENT

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://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

  • The record must already exist in DigitalOcean's DNS so that it can be updated. (manually find your IP and add it to DO's DNS it will later be updated)
  • A Digital Ocean API key that can be created at https://cloud.digitalocean.com/account/api/tokens.

Installation

Download the prebuilt binaries from releases,

or Build from source

# Requires Git, Go 1.8+(GO 1.11 if you want to use GO111MODULE=on).
# clone the repo in ~/go/src/github.com/anaganisk:
git clone https://github.com/anaganisk/digitalocean-dynamic-dns-ip.git
# Skip to next step, if you have GO111MODULE=on in your environment it is fetched automatically
go get github.com/mitchellh/go-homedir
# build the project
go build

Usage

Create a file .digitalocean-dynamic-ip.json (dot prefix to hide the file) and place it in your home directory. Add the following JSON (or refer to the sample configuration file, digitalocean-dynamic-ip.sample.json):

{
  "apikey": "samplekeydasjkdhaskjdhrwofihsamplekey",
  "doPageSize": 20,
  "useIPv4": true,
  "useIPv6": false,
  "allowIPv4InIPv6": false,
  "ipv4CheckUrl": "https://api.ipify.org/?format=text",
  "domains": [
    {
      "domain": "example.com",
      "records": [
        {
          "name": "subdomainOrRecord",
          "type": "A"
        }
      ]
    },
    {
      "domain": "example2.com",
      "records": [
        {
          "name": "subdomainOrRecord2",
          "type": "A",
          "TTL": 30
        }
      ]
    }
  ]
}

The TTL can optionally be updated if passed in the configuration. Digital Ocean has a minimum TTL of 30 seconds. The type and the name must match existing records in the Digital Ocean DNS configuration. Only types of A and AAAA allowed at the moment. Use the name of "@" to update a the top level domain record itself instead of a sub domain.

If you want to reduce the number of calls made to the digital ocean API and have more than 20 DNS records in your domain, you can adjust the doPageSize parameter. By default, Digital Ocean returns 20 records per page. Digital Ocean has a max page size of 200 items.

By default, the configuration checks both IPv4 and IPv6 addresses assuming your provider set up your connection as dual stack. If you know you only have ipv4 or ipv6 you can disable using one or the other in the config. To disable one or the other, set the useIPv4 or useIPv6 settings to false. If the options aren't present, or are set to null, then the configuration assumes a value of true.

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://api.ipify.org/?format=text and https://api64.ipify.org/?format=text respectively.

# after running `go build digitalocean-dynamic-ip.go`, run:
./digitalocean-dynamic-ip

Optionally, you can create the configuration file with any name wherever you want, and pass it as a command line argument:

#run:
./digitalocean-dynamic-ip /path/to/my/config.json

By default the tool will not output anything on success. If you wish to see debug messages, you can use the -d or -debug command flags. All debug messages will be printed to Standard Out, while warnings and fatal errors will be printed to Standard Error. Warnings and Error messages are always printed regardless of the -d/-debug flag usage.

#run:
./digitalocean-dynamic-ip -debug /path/to/my/config.json

You can either set this to run periodically with a cronjob or use your own method.

# run `crontab -e` to edit your crontab
# sample cron job task

# m h  dom mon dow   command
*/5 * * * * /home/user/digitalocean-dynamic-dns-ip/digitalocean-dynamic-ip
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].