GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Explore
  • Repositories
  • Docs
  • API Center
  • interweb.co.mz
  • PT
  • Help
  • Sign in

This view

  • Original page
  • New address

GeezerVison is showing git.interweb.co.mz — ddns

interweb-mz/ddns
Watch
1
0
Fork 0
Code Issues Pull requests Projects Releases 1 Wiki Activity
Dynamic DNS client for Interweb Mozambique domains: keeps A and AAAA records updated on OpenWrt routers, Raspberry Pi, Linux, Windows and Docker https://docs.interweb.co.mz
api ddns dns dynamic-dns interweb interweb-mz mozambique
5 commits 1 branch 1 tag 42 KiB
  • Shell 53%
  • PowerShell 44.5%
  • Dockerfile 2.5%
Find a file
Exact
Repository files (latest commit first)
Filename Latest commit message Latest commit date
root 5442a8724e Show the English README by default
2026-11-28 11:06:10 +02:00
.github Add CI workflow and Dependabot 2026-11-28 09:16:09 +02:00
openwrt Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
systemd Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
CHANGELOG.md Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
ddns.conf.example Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
ddns.ps1 Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
ddns.sh Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
Dockerfile Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
LICENSE Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
README-pt.md Show the English README by default 2026-11-28 11:06:10 +02:00
README.md Show the English README by default 2026-11-28 11:06:10 +02:00
repo.json Use badges from the brand git 2026-11-28 10:59:55 +02:00

README.md

Dynamic DNS for Interweb Mozambique

Release License: MIT

Reach your home, office or camera by name, even when the internet provider changes your IP. This client checks the public IP of your network and, when it changes, updates an A (IPv4) and/or AAAA (IPv6) record of your domain through the Interweb Mozambique API.

Português

What File
OpenWrt routers, Raspberry Pi, Linux, macOS ddns.sh (POSIX sh and curl)
Windows ddns.ps1 (PowerShell 5.1 or 7)
systemd systemd/ddns.service and systemd/ddns.timer
OpenWrt, update as soon as the WAN comes up openwrt/hotplug
Docker Dockerfile

Before you start

  1. The domain must be active on your account, with DNS on.
  2. Create an API key with the dns:read and dns:write permissions in the API Center of Meu Interweb. Do not give it an IP list: your IP is the thing that changes. Test first with a sandbox_ key: the client runs normally and nothing changes in the zone.
  3. Pick a name, such as home, for home.example.co.mz.

The address of the API is already in the client. You only give the key.

Linux and Raspberry Pi (systemd)

sudo install -m 755 ddns.sh /usr/local/bin/interweb-mz-ddns
sudo install -m 600 ddns.conf.example /etc/interweb-mz-ddns.conf
sudo nano /etc/interweb-mz-ddns.conf        # key, domain and name
sudo interweb-mz-ddns                        # first run, by hand
sudo install -m 644 systemd/ddns.service /etc/systemd/system/interweb-mz-ddns.service
sudo install -m 644 systemd/ddns.timer /etc/systemd/system/interweb-mz-ddns.timer
sudo systemctl daemon-reload
sudo systemctl enable --now interweb-mz-ddns.timer

It checks every 5 minutes. See what it did with journalctl -u interweb-mz-ddns. Without systemd, use cron: */5 * * * * /usr/local/bin/interweb-mz-ddns -q.

OpenWrt

opkg update && opkg install curl ca-bundle
cp ddns.sh /usr/bin/interweb-mz-ddns && chmod 755 /usr/bin/interweb-mz-ddns
cp ddns.conf.example /etc/interweb-mz-ddns.conf && chmod 600 /etc/interweb-mz-ddns.conf
vi /etc/interweb-mz-ddns.conf
echo '*/5 * * * * /usr/bin/interweb-mz-ddns -q' >> /etc/crontabs/root && /etc/init.d/cron restart
cp openwrt/hotplug /etc/hotplug.d/iface/95-interweb-mz-ddns

If the WAN interface of the router has the public IP, set DDNS_IFACE=wan and the client reads it from there, without asking anyone. Set DDNS_SYSLOG=yes to see changes in logread. If the address is private (10.x, 192.168.x, 100.64.x), the router is behind another one: keep the default address service.

The API has no dyndns2 update address, so the Dynamic DNS menu built into routers cannot be used with it. Run this client on the router instead.

Windows

[Environment]::SetEnvironmentVariable('INTERWEB_API_KEY', 'prod_...', 'User')
.\ddns.ps1 -Domain example.co.mz -Name home -Type A

Every 5 minutes with Task Scheduler:

$action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument '-NoProfile -ExecutionPolicy Bypass -File C:\ddns\ddns.ps1 -Domain example.co.mz -Name home -Quiet'
$trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes 5)
Register-ScheduledTask -TaskName 'Interweb Mozambique DDNS' -Action $action -Trigger $trigger

Docker

docker build -t interweb-mz-ddns .
docker run -d --restart unless-stopped --name ddns \
  -e INTERWEB_API_KEY=prod_... -e DDNS_DOMAIN=example.co.mz -e DDNS_NAME=home \
  interweb-mz-ddns

For AAAA records, add --network host so the container has IPv6.

Settings

Setting Default What
INTERWEB_API_KEY The API key. Or DDNS_API_KEY_FILE with the path of a file holding it.
DDNS_DOMAIN Your domain.
DDNS_NAME @ Names to update, separated by spaces. @ is the domain itself.
DDNS_TYPE A A, AAAA or both.
DDNS_TTL 300 Seconds, from 60.
DDNS_IP4_URL, DDNS_IP6_URL ipify, icanhazip Address services, tried in order.
DDNS_IFACE, DDNS_IFACE6 Read the IP from this interface instead.
DDNS_IP4, DDNS_IP6 A fixed address.
DDNS_FORCE_HOURS 24 Check the zone again after this many hours even without a change.
DDNS_DELETE_EXTRA no yes deletes other records with the same name and type.
DDNS_INTERVAL 300 Seconds between checks with --loop.

Options of ddns.sh: --force, --dry-run, --loop, -q, -c FILE. The PowerShell script takes the same settings as parameters (-Domain, -Name, -Type, -Ttl, -Force, -DryRun, -DeleteExtra, -Quiet) or the same environment variables.

How it works

The API has no operation that tells you your own IP, so the client asks an address service (by default api.ipify.org, then icanhazip.com), reads it from an interface, or uses the value you give. It remembers the last IP it sent and only calls the API when the IP changes, or once every DDNS_FORCE_HOURS. Then it reads the zone, changes the record if the value is different, or creates it if there is none. The key is never printed, and it reaches curl through standard input, so it does not show in the process list.

A copy of the zone is kept before each change: you can go back in Meu Interweb or with the API. More in the DNS documentation.

License

MIT. See LICENSE.


Maintained by RLX Holdings.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.