Files
ddhclient/docs/dyndns-namecheap-alpine.md
alexandrev-tibco 57d4cf2698 +1
2026-02-01 15:13:51 +01:00

2.7 KiB

Namecheap Dynamic DNS on Alpine (LXC) with ddclient

This setup uses one ddclient instance to update a single dynamic host per domain, then points all service subdomains at that host via CNAMEs.

  • Create an A record dyn (e.g. dyn.example.com) and let ddclient update it.
  • Convert all service subdomains (blog, grafana, calibre, etc.) to CNAME records pointing to dyn.<domain>.
  • Optionally create a wildcard CNAME * pointing to dyn.<domain> and add exceptions for any hosts that should not follow the wildcard.
  • Apex @ cannot be a CNAME on Namecheap. Keep @ as an A record. You can update @ via ddclient if you choose (the template includes @ entries), but the recommended default is dyn + CNAMEs.

Namecheap “Advanced DNS” steps

Repeat these steps for each domain:

  1. Create an A record for the dynamic host:

    • Type: A Record
    • Host: dyn
    • Value: your current public IP (will be updated by ddclient)
    • TTL: Auto
  2. Convert each subdomain to CNAME:

    • Type: CNAME Record
    • Host: blog (or grafana, calibre, etc.)
    • Value: dyn.<domain>
    • TTL: Auto
  3. Optional wildcard:

    • Type: CNAME Record
    • Host: *
    • Value: dyn.<domain>
    • TTL: Auto
    • Note: wildcard CNAMEs are not updated by ddclient.

Note: some Namecheap setups require enabling Dynamic DNS per host in their panel. If updates fail, verify that Dynamic DNS is enabled for the dyn host.

Alpine validation

  • Check detected public IP:

    curl -s https://dynamicdns.park-your-domain.com/getip
    
  • Run ddclient once in debug mode:

    ddclient -daemon=0 -debug -verbose -noquiet
    
  • Check logs:

    tail -f /var/log/messages
    # or
    logread -f
    

Config placement and secrets

  • Place your real Namecheap Dynamic DNS token in /etc/ddclient/ddclient.conf.
  • Do not commit real API tokens to this repo. Use the template at templates/ddclient/ddclient.conf.template as a reference.
  • The Namecheap Dynamic DNS Password (not the API key) is required for each domain.

Environment variable list (per domain)

These are used by the installer when it writes /etc/ddclient/ddclient.conf:

  • NAMECHEAP_DDNS_PASSWORD_ALEXANDRE_VAZQUEZ_CLOUD
  • NAMECHEAP_DDNS_PASSWORD_ALEXANDRE_VAZQUEZ_COM
  • NAMECHEAP_DDNS_PASSWORD_PORTFOLIOJOURNAL_APP
  • NAMECHEAP_DDNS_PASSWORD_XSLTPLAYGROUND_COM
  • NAMECHEAP_DDNS_PASSWORD_OLALLALAB_ORG

Simple shell setup for Alpine (root login shell)

This helper script appends the exports to /root/.profile for the default ash login shell:

./scripts/setup-ddclient-env-alpine.sh

Edit the REPLACE_ME values in /root/.profile, then re-login or run:

. /root/.profile