https://github.com/mrfootoyou/ddns
DDNS registration client for Cloudflare using cross-platform PowerShell
https://github.com/mrfootoyou/ddns
cloudflare cross-platform ddns ddns-client ddns-updater powershell
Last synced: 3 months ago
JSON representation
DDNS registration client for Cloudflare using cross-platform PowerShell
- Host: GitHub
- URL: https://github.com/mrfootoyou/ddns
- Owner: mrfootoyou
- Created: 2018-09-03T05:48:48.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2026-01-12T02:06:03.000Z (3 months ago)
- Last Synced: 2026-01-12T06:57:38.664Z (3 months ago)
- Topics: cloudflare, cross-platform, ddns, ddns-client, ddns-updater, powershell
- Language: PowerShell
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DDNS Registration Client
A PowerShell 7+ script to update dynamic DNS (DDNS) records for IPv4 and IPv6
addresses. It currently supports updating
[Cloudflare DNS](https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-patch-dns-record)
records in [Cloudflare](https://www.cloudflare.com/products/registrar/).
## Usage
Create a config file at `~/.ddns/config.json` and add your records to it. See
[./config.json](./config.json) for an example.
```powershell
# Copy the example config file to the user's home directory if it doesn't already exist
if (!(Test-Path -Path '~/.ddns/config.json')) {
$null = New-Item '~/.ddns' -ItemType Directory -Force
Copy-Item './config.json' '~/.ddns/config.json'
# e.g., code (Convert-Path '~/.ddns/config.json')
}
```
Run the script to update the configured DDNS records:
```powershell
./update-ddns.ps1
```
The script will log its actions to `~/.ddns/update.log` and maintain a status
file at `~/.ddns/status.json`. Both of these paths can be customized in the
config file.
## Run on a schedule
Use the following PowerShell script to create a Windows Scheduled Task which
starts at logon of the current user and then runs daily at 8AM:
```powershell
cd C:\dev\ddns # path to where update-ddns.ps1 is located
New-ScheduledTask `
-Action (New-ScheduledTaskAction `
-Execute (Get-Command pwsh).Path `
-Argument '-nologo -nop -ep bypass -w hidden -f update-ddns.ps1' `
-WorkingDirectory $PWD) `
-Trigger `
(New-ScheduledTaskTrigger -AtLogOn),
(New-ScheduledTaskTrigger -Daily -At (Get-Date '08:00')) | `
Register-ScheduledTask -TaskName 'Update DDNS' -Force
# Execute now:
Start-ScheduledTask -TaskName 'Update DDNS'
# Delete:
# Unregister-ScheduledTask -TaskName 'Update DDNS'
```