legitdns.
FeaturesUse casesDocsSign inGet started

legitdns on macOS

For a Mac that stays on at home - the mini in the closet, the studio machine - there are three ways to keep a hostname current:

  • A small script plus launchd - nothing to install; macOS runs it every five minutes. This is the route we recommend on a Mac.
  • ddclient from Homebrew - if you already use Homebrew and want a packaged client.
  • A GUI app - one current app documents custom endpoints; see the end of the page.

This page covers current macOS (Ventura 13 and later). Examples use the sample hostname mypi.pihome.example; use your own hostname and its token (see Tokens).

Honest status up front: the update call below is the same DynDNS2 request the client guides test against the service, but these macOS setups have not been run on a real Mac by us. Treat the page as "should work - not yet verified", the same label the router guides carry, and let your history page (see troubleshooting) be the judge.

A script plus launchd

launchd is the scheduler built into macOS: it runs a program on an interval, starting at login. cron still exists on macOS, but launchd is the current way and the one documented here.

1. Save the update script

Save this as ~/bin/legitdns-update.sh (create the folder first if needed). Replace mypi.pihome.example with your hostname and <token> with its token:

#!/bin/sh
# One legitdns update, run by launchd.
# Address-less on purpose: the service publishes
# the address this request arrives from.
HOSTNAME=mypi.pihome.example
TOKEN="<token>"
LOG="$HOME/Library/Logs/legitdns-update.log"

ANSWER=$(curl -s -u "$HOSTNAME:$TOKEN" \
  "https://legitdns.com/nic/update?hostname=$HOSTNAME")
echo "$(date '+%Y-%m-%d %H:%M:%S') $ANSWER" >> "$LOG"

Make it runnable and try it once by hand:

chmod +x ~/bin/legitdns-update.sh
~/bin/legitdns-update.sh
tail -1 ~/Library/Logs/legitdns-update.log

The log line should end in good (the address changed) or nochg (it was already current) - the answer codes are in the DynDNS2 page. The script holds your token, so keep it in your own folders only, as above.

One call publishes the address of the family it connects over. On a connection with IPv6, add a twin call with curl -6 in place of curl to publish that family too.

2. Tell launchd to run it

Save this as ~/Library/LaunchAgents/com.legitdns.update.plist, replacing YOURNAME with your short username (echo $HOME shows the full path - launchd needs the real path, not a ~):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.legitdns.update</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Users/YOURNAME/bin/legitdns-update.sh</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>StartInterval</key>
    <integer>300</integer>
    <key>StandardErrorPath</key>
    <string>/Users/YOURNAME/Library/Logs/legitdns-update.log</string>
</dict>
</plist>

StartInterval is seconds: 300 is five minutes. RunAtLoad runs it once at every login as well.

Load it (the current form of the command; launchctl load is the older spelling of the same thing):

launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.legitdns.update.plist

Check it is registered and running:

launchctl list | grep legitdns

The middle column is the last exit code - 0 is a clean run - and a - in the first column just means the script is between runs, not stuck. The log's newest line is the real proof.

To change the interval, edit StartInterval in the plist, then reload:

launchctl bootout gui/$(id -u)/com.legitdns.update
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.legitdns.update.plist

To remove it completely:

launchctl bootout gui/$(id -u)/com.legitdns.update
rm ~/Library/LaunchAgents/com.legitdns.update.plist

ddclient from Homebrew

If you already run Homebrew, its ddclient is a packaged alternative to the script above:

brew install ddclient

Two honest notes. Homebrew currently packages ddclient 4.0.0 - newer than the 3.10.0 we tested (see the client guides) - and the Homebrew packaging itself has not been run on a real Mac by us: should work - not yet verified. The configuration is the one in the ddclient section of the client guides; on a Mac it lives at:

  • Apple silicon: /opt/homebrew/etc/ddclient/ddclient.conf
  • Intel: /usr/local/etc/ddclient/ddclient.conf

($(brew --prefix)/etc/ddclient/ddclient.conf finds it either way.) Do not set daemon= in that file - the service below provides the schedule. Start it:

sudo brew services start ddclient

Homebrew installs it as a system service that starts at boot; the run interval is the StartInterval value in /Library/LaunchDaemons/sh.brew.ddclient.plist. sudo brew services list shows its state.

What about inadyn, the other client in the client guides? Its maker archived the project in October 2025, and Homebrew has since disabled its inadyn formula, so there is no current Homebrew install of it. On a Mac, use ddclient above or the launchd script.

A GUI option: dDNS Broker SE

Prefer an app? dDNS Broker SE (AppQuarter, on the Mac App Store; free to download, with a paid annual license for its main functions) is the one current Mac app we found that documents custom endpoints, through its Generic Provider records. It has not been tested by us - should work - not yet verified - but its own manual documents every field:

  • Provider: a Generic Provider record (the Regex flavour).
  • Update URL: https://legitdns.com/nic/update?hostname=mypi.pihome.example&myip=<ip> (<ip> is the app's own placeholder for your public address.)
  • Authorization: the Basic header for mypi.pihome.example:<token> - the app's tutorial shows how that header value is built.
  • Success Regex Match: good|nochg - the two answers that mean the update landed.

The better-known Mac updaters cannot be used here: Dyn's updater and No-IP's client only talk to their own services, with no custom server setting to point at legitdns.

See also: Client guides, Update methods, Troubleshooting.

legitdns - free dynamic DNS for home serversEULAPrivacyStatusReport abuseFeedback