Skip to content

DNS Automation

This project includes a tool to automate DNS configuration via Namecheap API.

Pre-requisites

  1. Namecheap API Key (Whitelisted IP needed).
  2. Credentials in Doppler:
    • NAMECHEAP_API_USER
    • NAMECHEAP_API_KEY

Tool: tools/dns-automation.ts

This script: 1. Detects current Public IP. 2. Fetches existing records for singulardream.org (to avoid overwriting). 3. Injects/Updates the docs CNAME record pointing to sd-hoa.github.io. 4. Pushes the full record set back to Namecheap.

Usage

doppler run -- npx tsx tools/dns-automation.ts

Note: This script logic is required because Namecheap's setHosts command is destructive (it replaces ALL records). We heavily rely on accurate fetching before saving.