From c50eff7301aaf1b134b37552e932f0f3de19e4eb Mon Sep 17 00:00:00 2001 From: Lukas Werner Date: Tue, 8 Jul 2025 11:11:58 -0700 Subject: [PATCH] update readme --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 8fef587..1641f54 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,31 @@ # dynamic-dns > "What I cannot create, I do not understand" – Richard Feynman + + +## Sample configuration +```lua +local http = require("http") +local json = require("json") +-- Domains to monitor / update +dns.cloudflare["CF_TOKEN_CONTENTS"] = { + "example.com", +} + +function check_aws() + local resp, status = http.get("https://checkip.amazonaws.com/", {}) + return resp, status +end + +-- Define how to check IPv4 Address +dns.get_ipv4 = function() + local ip, status = check_aws() + if status == 200 then + return ip + end + return "" +end + +-- Interval to update the DNS records +dns.interval = 2 * time.duration.hour +``` -- 2.51.2