The command-line interface for Namefi: sign in, list the domains in your account, and keep DNS records pointed at a machine whose public address changes (dynamic DNS).
The dynamic DNS daemon reacts to OS network events rather than polling, so a new address is published within seconds of the link changing, and an unchanged address costs zero API calls.
Source of truth: the CLI is developed in
d3servelabs/namefi-astraunderprojects/namefi-dyndns. This repository exists to publish the built binaries and the installers. Open issues and pull requests againstnamefi-astra.
curl -fsSL https://github.com/raw/d3servelabs/namefi-cli/main/install.sh | shThe script detects your OS and CPU, downloads the matching release asset,
verifies its SHA-256 against checksums.txt, and installs to
/usr/local/bin (or ~/.local/bin when that is not writable). It prints
everything it is about to do and is safe to re-run.
| Variable | Effect |
|---|---|
NAMEFI_CLI_VERSION |
Pin a release, e.g. v0.1.0. Default: latest. |
NAMEFI_INSTALL_DIR |
Install somewhere else, e.g. ~/bin. |
NAMEFI_CLI_VERSION=v0.1.0 NAMEFI_INSTALL_DIR="$HOME/bin" sh install.shPowerShell (recommended):
irm https://raw.githubusercontent.com/d3servelabs/namefi-cli/main/install.ps1 | iexOr download install.bat and double-click it; it delegates to
install.ps1. Both install to %LOCALAPPDATA%\Programs\namefi, add that
directory to your user PATH, and verify the checksum. Open a new terminal
afterwards so the PATH change takes effect.
go install github.com/d3servelabs/namefi-astra/projects/namefi-dyndns/cmd/namefi@latestgo install builds without version stamping, so namefi --version reports
dev.
Grab an archive from Releases,
verify it, extract it, and put namefi on your PATH:
curl -fsSLO https://github.com/d3servelabs/namefi-cli/releases/download/cli-v0.1.0/namefi_v0.1.0_linux_amd64.tar.gz
curl -fsSLO https://github.com/d3servelabs/namefi-cli/releases/download/cli-v0.1.0/checksums.txt
sha256sum -c checksums.txt --ignore-missing
tar -xzf namefi_v0.1.0_linux_amd64.tar.gz
sudo install -m 755 namefi /usr/local/bin/namefiAssets are named namefi_<version>_<os>_<arch>.tar.gz (.zip on Windows) for
darwin/amd64, darwin/arm64, linux/amd64, linux/arm64,
windows/amd64, and windows/arm64.
namefi login # browser sign-in; the session renews itself
namefi status # which credential is active, and why
namefi domains list # your portfolio
# Dynamic DNS for one hostname, using a scoped credential from the dashboard
# (Domain settings -> Dynamic DNS):
namefi dyndns creds set --username ddns_… --scope home.example.com
namefi dyndns check # resolve + diff, writes nothing
namefi dyndns run # daemon: publish on every address changeThree credential sources, in the order they win:
- Scoped dynamic DNS credential — a username/secret pair created in the
Namefi dashboard, stored in your OS keyring by
namefi dyndns creds set, or supplied asNAMEFI_DYNDNS_USERNAME/NAMEFI_DYNDNS_SECRETfor containers and services. Never expires, limited to one hostname pattern. This is the right credential for a daemon. - Account API key —
NAMEFI_API_KEY, environment only by design, never written to disk. Full account access, survives restarts, needs no browser. - Stored login —
namefi loginputs an account session in the keyring.
Whichever wins is printed at startup, e.g.
credential: scoped dyndns (keyring) — home.example.com. Run namefi status
to see it at any time.
Account logins are sessions, not durable credentials. namefi login
(browser, RFC 8252 loopback + PKCE) also receives a rotating refresh token, so
the CLI renews the ~12h access token on its own. namefi login --device — the
headless fallback — receives no refresh token, so that session simply ends
at expiry. Running namefi dyndns run on any account login prints a warning
telling you when the session ends and recommending a scoped credential or
NAMEFI_API_KEY instead.
namefi domains list reads account data, so it requires an account credential
(API key or login); a scoped dynamic DNS credential cannot see your portfolio.
The server is always the authority, but the CLI fails fast locally when the configured scope clearly excludes the hostname:
| Scope | Matches |
|---|---|
home.example.com |
that exact hostname |
*.example.com |
any single-label descendant |
example.com |
zone-wide: the apex or any descendant |
| Command | What it does |
|---|---|
namefi login |
Browser sign-in on this machine; the session auto-renews. |
namefi login --device |
Headless sign-in: open the printed URL elsewhere. No auto-renewal. |
namefi logout |
Remove the stored session from the keyring. |
namefi status |
Show which credential is active and where it came from. |
namefi domains list |
List the account's domains. --long, --json, --names-only, --search, --expiring-in 720h, --ns namefi|external, --parked, --sort name|expiry. |
namefi dyndns run |
Daemon: publish on network events, with a fallback poll. |
namefi dyndns update |
One-shot: resolve current addresses, push, exit. |
namefi dyndns check |
Resolve and diff against the push cache. Writes nothing. |
namefi dyndns creds set |
Store a scoped credential. --username, --scope. |
namefi dyndns creds show |
Inspect the stored credential (never prints the secret). |
namefi dyndns creds clear |
Delete the stored credential. |
namefi --version |
Print the stamped version. |
Flags shared by the dyndns commands: --hostname, --ipv4 / --ipv6 (both
on by default), --zone, --ttl, --update-host, --state-file, --map.
run adds --settle (default 7s) and --poll-interval (default 5m).
Configuration layers flags → environment → file.
namefi dyndns run # both address families
namefi dyndns run --ipv6=false # IPv4 only
namefi dyndns run --verbose # log the event stream- Pushes immediately at startup, then reacts to link-change events, debounced by
--settle. - A fallback poll every
--poll-intervalcatches upstream/CGNAT changes that produce no local event. - The push cache lives at
~/.config/namefi/dyndns-state.jsonand is written only after a confirmed success, so a failed push retries on the next tick. - IPv4 and IPv6 are independent tracks. A missing family is a no-op, never a delete: an IPv6 outage will not clear your AAAA record.
- Transient failures retry with jittered exponential backoff. Auth, scope, and config errors are terminal so a supervisor can tell "retry" from "give up".
- SIGINT / SIGTERM shut down cleanly. Credential material is never logged.
For a machine behind a home router, --map asks the gateway to forward ports
over the LAN — no router login required:
namefi dyndns run --map 443/tcp --map 22/tcp # external port = internal port
namefi dyndns run --map 8443:443/tcp # external 8443 -> internal 443
namefi dyndns check --map 443/tcp # diagnose without writing- Protocol chain: PCP → NAT-PMP → UPnP IGD, first success wins.
- Mappings are leases: renewed at half-lifetime, re-established after link changes (a router reboot wipes its table), released on clean shutdown.
- Publishing is reachability-gated. With
--mapset, the A record is only published while every mapping is granted — publishing a router address that drops the traffic would be wrong. A blocked IPv4 printswithheld: …; IPv6 is not gated because it has no NAT. check --map …reports the gateway, the protocol that worked, the granted lease, and names CGNAT plainly instead of failing mysteriously.
Example unit files live in the source repository:
- systemd (Linux):
projects/namefi-dyndns/contrib/systemd/namefi-dyndns.service - launchd (macOS):
projects/namefi-dyndns/contrib/launchd/io.namefi.dyndns.plist
Use a scoped dynamic DNS credential or NAMEFI_API_KEY for a service; an
account login will expire under it.
| Code | Meaning |
|---|---|
0 |
Success. |
1 |
Transient or unexpected failure — retrying later may work. |
2 |
Configuration error — the invocation or config file is wrong. |
3 |
Authentication error — sign in again or fix the credential. |
4 |
Scope violation — the credential may not update that hostname. |
Codes 2, 3, and 4 are terminal: a supervisor should not restart on them.
Source, design notes, and issue tracking:
namefi-astra/projects/namefi-dyndns.
Releases and installers are published here by the CLI Release workflow in that
repository.