legitdns.
FeaturesUse casesDocsSign inGet started

legitdns on Windows

Two ways to keep a hostname updated from a Windows machine: a small PowerShell script that Windows itself runs on a schedule (nothing extra to install), or a Windows DDNS client that can be pointed at a custom server.

Honesty first: the update address and the Basic-auth convention below are the ones our tested clients use, but nothing on this page has been run by us on a real Windows machine yet. Treat this page like the router guides: "should work - not yet verified". What would verify it is the test we run for every client - send an update, check the answer in DNS, and check the history in the panel. After your first run, check History in your panel to confirm updates are arriving.

Examples use mypi.pihome.example; use your own hostname and token.

PowerShell scheduled updater

Windows already ships everything this needs: PowerShell and Task Scheduler. The script sends one update and appends the answer to a log file; Task Scheduler runs it every five minutes.

The update sends no address, so we publish the address the request comes from - the normal address-less flow (see the DynDNS2 page). No third-party address service is involved.

One run publishes one address - the family that run connected over - not both families at once. On a typical home connection that is the IPv4 address.

1. Save the script

Create a folder C:\legitdns and save this as C:\legitdns\legitdns-update.ps1. Edit the two lines at the top - your hostname and its token - and nothing else:

# legitdns update script for Windows.
$Hostname = "<hostname>"   # your full hostname
$Token    = "<token>"      # that hostname's token

# Make sure TLS 1.2 is on (Windows PowerShell 5.1).
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

$Url = "https://legitdns.com/nic/update?hostname=$Hostname"
$Pair = "$($Hostname):$($Token)"
$Basic = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($Pair))
$Headers = @{ Authorization = "Basic $Basic" }

$Log = Join-Path $PSScriptRoot "legitdns-update.log"
$Stamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"

try {
    $Answer = Invoke-RestMethod -Uri $Url -Headers $Headers -UserAgent "legitdns-powershell/1.0"
    "$Stamp $Answer" | Out-File -FilePath $Log -Append -Encoding ascii
}
catch {
    "$Stamp FAILED $($_.Exception.Message)" | Out-File -FilePath $Log -Append -Encoding ascii
}

The script holds your token, like every client config: keep it in a folder only your account can read.

2. Test it once

powershell -ExecutionPolicy Bypass -File C:\legitdns\legitdns-update.ps1

Then read C:\legitdns\legitdns-update.log: a line ending in good (or nochg) means the update worked. The -ExecutionPolicy Bypass covers this one run only; it does not change your machine's policy.

3. Schedule it

Open PowerShell as administrator and paste this block:

$ScriptPath = "C:\legitdns\legitdns-update.ps1"
$Action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -File `"$ScriptPath`""
$Trigger = New-ScheduledTaskTrigger -AtLogOn
$Trigger.Repetition.Interval = "PT5M"
Register-ScheduledTask -TaskName "legitdns update" -Action $Action -Trigger $Trigger -Force

The task starts when you sign in and repeats every five minutes while you are signed in. That is plenty for a home connection - see "being a good citizen" on the DynDNS2 page.

Check, change, or remove it

  • Did it run? Get-ScheduledTaskInfo -TaskName "legitdns update" shows the last run time and result (0 means the script ran); the log file shows every answer.
  • Change the interval: run the install block again with a different repetition - PT10M for ten minutes, PT1H for an hour.
  • Remove it: Unregister-ScheduledTask -TaskName "legitdns update" -Confirm:$false, then delete the folder if you like.

One hostname per script. For a second hostname, save a copy under another name, edit its two lines, and register a second task under another task name.

Versions: the script is written for Windows PowerShell 5.1, the version that ships with Windows 10 and 11, and it also runs on PowerShell 7.

Windows clients

Prefer a program with a tray icon and settings screens? Few Windows DDNS clients can be pointed at a service that is not on their own list. These can, per their makers' documentation:

Kana Dynamic IP Updater

Kana Solution's updater talks to other providers through a provider configuration file - the maker documents the format, and their own profile for a /nic/update service is the model for ours.

  1. In the program's DynDNS.ini, under [Options] add IsDynDNS=0 (this turns on multi-provider mode), and under [SvcProvider] add a line 3="legitdns.com" - use the next free number if 3 is taken.
  2. Save this as Profile_legitdns.ini in the same folder:
[default]
withpass=1
host=legitdns.com
port=443
path=/nic/update
protocol=https

[requests]
hostname=%HOST%
myip=%IP%

[result]
multilines=0
success=good
success=nochg
warning=abuse
warning=nohost
  1. In the program, add a group: username is your hostname, password is the token. Add the hostname itself with System set to "custom". On the group's Options tab, set Provider to the name from step 1 and Profile to the file from step 2.
  2. Check History in your panel to confirm updates are arriving.

Marc's Updater

Marc's Updater runs as a Windows service. Its maker documents custom providers as a JSON file - currently for the unstable testing version only, which is worth knowing before you rely on it:

Save this as legitdns.json in %PROGRAMDATA%\Marcs Updater\ServiceProviders\, with your own hostname and token in the defaults:

{
    "name": "legitdns",
    "endpoint": "https://legitdns.com/nic/update",
    "method": "GET",
    "queryString": "hostname={HOSTNAME}&myip={MYIP}",
    "dataPayload": "",
    "defaults": {
        "username": "<hostname>",
        "password": "<token>",
        "hostname": "<hostname>"
    }
}

Restart the service and the app, then pick the legitdns provider and confirm the hostname and token. Check History in your panel to confirm updates are arriving.

Not with legitdns

One line each, so you do not spend time on them:

  • No-IP DUC - No-IP's client updates No-IP hostnames with a No-IP account. There is no custom server setting.
  • Dyn Updater - Dyn's own client (its installer is called DynUp) signs in to a Dyn account and downloads that account's hosts. No custom server.
  • ddns-updater - its DynDNS-style provider is fixed to Dyn's own update address and ignores the server field.
  • DirectUpdate - documents a long list of built-in providers; we could not confirm a custom-service option in the maker's own documentation, so it is not listed above.

See also: Client guides, DynDNS2 protocol, Troubleshooting.

legitdns - free dynamic DNS for home serversEULAPrivacyStatusReport abuseFeedback