#dns-records #netlify #dns #ddns #dynamic #public-ip #cron-job

bin+lib netlify-ddns

A simple CLI tool for setting Netlify DNS records dynamically

11 releases

0.3.4 Jan 19, 2024
0.3.3 Jun 20, 2023
0.3.2 Nov 2, 2022
0.3.0 Jan 4, 2021
0.2.1 Nov 8, 2019

#937 in Command line utilities

Download history 3/week @ 2024-01-15 100/week @ 2024-02-12 7/week @ 2024-02-19 15/week @ 2024-02-26 3/week @ 2024-03-11 85/week @ 2024-04-01

85 downloads per month

BlueOak-1.0.0

25KB
499 lines

🌐
netlify-ddns

A CLI tool for setting Netlify DNS records dynamically.


netlify-ddns is a simple command line tool for creating a DNS record for Netlify's Managed DNS service. It is meant to be run as a cron job and queries third-parties (multiple, in case one is down) for your public IP, then updates or adds a DNS record using the Netlify API.

Installation

Install using cargo:

cargo install netlify-ddns

Usage

A simple CLI tool for setting Netlify DNS records dynamically.

Usage: netlify-ddns [OPTIONS] --domain <DOMAIN> --token <TOKEN>

Options:
  -d, --domain <DOMAIN>        The full domain for the DNS record
  -s, --subdomain <SUBDOMAIN>  The subdomain segment for the DNS record [default: www]
      --ttl <TTL>              The TTL value in seconds to set with the record [default: 3600]
  -i, --ip-type <IP_TYPE>      Whether an IPv6 "AAAA" or an IPv4 "A" record should be updated [default: ipv4] [possible values: ipv4, ipv6]
  -t, --token <TOKEN>          Your Netlify personal access token [env: NETLIFY_TOKEN=]
  -h, --help                   Print help information
  -V, --version                Print version information

Example Cronjob

You could set a cronjob to update the dev.example.com hourly with a task like the following.

0 * * * * netlify-ddns -d example.com -s dev --token=<your token>

Dependencies

~12MB
~236K SLoC