Namecheap
GitHubOfficialFirst committed by brunoborgesDistributed by GitHub
- Skill
- Tool integration
- Automation and integrations
- MIT
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured way to interact with the Namecheap API to manage DNS records for domains. It includes a Python script that handles authentication, domain listing, and record management (A, AAAA, CNAME, MX, TXT, etc.). The skill emphasizes secure credential handling, requiring users to perform initial setup in their own terminal to ensure API keys are never exposed in the chat interface. It also includes safety checks, such as displaying current records before modifications and requiring confirmation for destructive operations.
What it does
- Lists domains registered under a Namecheap account.
- Retrieves and displays current DNS host records for a specific domain.
- Adds, updates, or removes individual DNS records like A, CNAME, and MX.
- Configures custom nameservers or reverts to Namecheap default DNS.
- Manages email forwarding rules for domains.
- Guides users through the secure API setup and IP whitelisting process.
When to use it
- When you need to update DNS records for a domain hosted on Namecheap.
- When you want to list your domains or check their current nameserver configuration.
- When you need to set up email forwarding for a domain.
- When you are performing initial API integration for Namecheap domain management.
Advantages
- Automates DNS record management without manual web dashboard navigation.
- Ensures security by keeping API credentials local to the user's machine.
- Provides safe, step-by-step workflows for modifying DNS records.
- Supports bulk updates via JSON files for complex record configurations.
Usage examples
- “List all my domains on Namecheap.”
- The agent executes the list command and presents a table of your domains, including their IDs and expiration dates.
- “Add an A record for www.example.com pointing to 1.2.3.4.”
- The agent fetches current records, confirms the change with you, and then adds the specified A record.
- “How do I set up the Namecheap API?”
- The agent provides instructions to whitelist your IP in the Namecheap dashboard and guides you to run the local setup script.
- “Show me the current DNS records for example.com.”
- The agent retrieves and displays the existing host records, including types, addresses, and TTL values.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/github/namecheap/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip namecheap.zip -d .agents/skills
Documentation by brunoborges
Namecheap DNS Management
UTILITY SKILL — manages DNS records via the Namecheap API. USE FOR: "add DNS record", "update A record", "manage Namecheap domains", "set CNAME", "add MX record", "add TXT record", "list my domains", "show DNS records", "namecheap setup", "configure namecheap API", "what is my public IP" DO NOT USE FOR: domain registration/purchase, SSL certificate management, hosting configuration, non-Namecheap DNS providers
Workflow
First-time Setup
Before executing any API commands, verify credentials are configured:
Check for existing config — look for
~/.namecheap-apiIf not configured, guide the user through setup: a. Show public IP — run
python3 namecheap.py public-ipto display the user's public IP b. Instruct IP whitelisting — tell the user to go to https://ap.www.namecheap.com/settings/tools/apiaccess/, enable API (select ON), and whitelist the displayed IP c. Have the user run setup themselves — ask the user to runpython3 namecheap.py setupdirectly in their own terminal. The script prompts for the username and reads the API key with a hidden prompt (getpass), writes~/.namecheap-apiwithchmod 600, and validates the connection. Never ask the user to paste their API key into the chat, and never log, echo, or display the API key value. If you cannot run an interactive terminal for the user, instruct them to runsetupthemselves, or to exportNAMECHEAP_API_USERandNAMECHEAP_API_KEYas environment variables in their own shell — rather than collecting the secret viaask_user. d. Confirm — once the user reports setup succeeded, proceed with DNS operations.
DNS Operations
Use the namecheap.py script (bundled in this skill's directory) for all API interactions. It requires only Python 3 (standard library only — no pip install needed) and works the same on macOS, Linux, and Windows:
# Show public IP (for setup)
python3 namecheap.py public-ip
# Run setup flow
python3 namecheap.py setup
# List domains
python3 namecheap.py domains.getList
# Get nameservers for a domain (shows if using Namecheap DNS or custom)
python3 namecheap.py domains.dns.getList --domain example.com
# Get DNS records for a domain
python3 namecheap.py domains.dns.getHosts --domain example.com
# Add a single record (preserves existing records)
python3 namecheap.py dns.addHost --domain example.com --type A --name www --address 1.2.3.4 --ttl 1800
# Remove a single record
python3 namecheap.py dns.removeHost --domain example.com --type A --name www --address 1.2.3.4
# Replace all records from a JSON file
python3 namecheap.py domains.dns.setHosts --domain example.com --hosts records.json
# Switch to Namecheap default DNS
python3 namecheap.py domains.dns.setDefault --domain example.com
# Switch to custom nameservers
python3 namecheap.py domains.dns.setCustom --domain example.com --nameservers ns1.cloudflare.com,ns2.cloudflare.com
# Get email forwarding rules
python3 namecheap.py domains.dns.getEmailForwarding --domain example.com
# Set email forwarding (single rule)
python3 namecheap.py domains.dns.setEmailForwarding --domain example.com --mailbox info --forward-to [email protected]
# Set email forwarding (from JSON file)
python3 namecheap.py domains.dns.setEmailForwarding --domain example.com --forwards forwards.json
# Create a child nameserver (glue record)
python3 namecheap.py domains.ns.create --domain example.com --nameserver ns1.example.com --ip 1.2.3.4
# Delete a child nameserver
python3 namecheap.py domains.ns.delete --domain example.com --nameserver ns1.example.com
# Get nameserver info
python3 namecheap.py domains.ns.getInfo --domain example.com --nameserver ns1.example.com
# Update nameserver IP
python3 namecheap.py domains.ns.update --domain example.com --nameserver ns1.example.com --old-ip 1.2.3.4 --ip 5.6.7.8JSON file formats
domains.dns.setHosts --hosts records.json expects an array of objects with Namecheap API field names:
[
{ "HostName": "@", "RecordType": "A", "Address": "1.2.3.4", "TTL": 1800 },
{ "HostName": "www", "RecordType": "CNAME", "Address": "@", "TTL": 1800 },
{ "HostName": "@", "RecordType": "MX", "Address": "mail.example.com.", "TTL": 1800, "MXPref": 10 }
]domains.dns.setEmailForwarding --forwards forwards.json expects an array of mailbox rules:
[
{ "MailBox": "info", "ForwardTo": "[email protected]" },
{ "MailBox": "sales", "ForwardTo": "[email protected]" }
]Behavior
Always check credentials first. Before any API operation, verify
~/.namecheap-apiexists and is readable. If not, run the setup flow.Show current records before modifying. Before adding or removing records, always fetch and display the current DNS records so the user can confirm the change.
Use
ask_userto confirm destructive changes. Before removing records or replacing all records withsetHosts, confirm with the user.The Namecheap
setHostsAPI replaces ALL records. Never calldomains.dns.setHostsdirectly unless you have fetched all existing records first. Usedns.addHostanddns.removeHostfor safe single-record operations — they handle the fetch-modify-write cycle internally.Explain TTL in human terms. When the user asks about TTL, explain that 1800 = 30 minutes, 3600 = 1 hour, etc.
Handle multi-part TLDs. Domains like
example.co.ukhave SLD=example and TLD=co.uk. The script recognizes a built-in list of common second-level suffixes (e.g.co.uk,com.au,co.jp,com.br). This list is best-effort and not a full public-suffix database — if a domain with an unlisted multi-part suffix returns a2019166("Domain not found") error, the SLD/TLD split was likely wrong. In that case, confirm the registered domain with the user and report the limitation.
Credential Storage
Credentials are stored in ~/.namecheap-api:
NAMECHEAP_API_USER="username"
NAMECHEAP_API_KEY="api-key-here"This file must have 600 permissions (owner read/write only). Alternatively, the script reads credentials from the NAMECHEAP_API_USER and NAMECHEAP_API_KEY environment variables, which take precedence over the file when both are set.
Supported Record Types
A, AAAA, CNAME, MX, MXE, TXT, URL, URL301, FRAME
References
See references/namecheap-api.md for full API documentation including request/response formats.
Files
- ATTRIBUTION.mdAdded by AutoGineer857 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md6.8 KiB
- namecheap.pyScript24.0 KiB
- references/namecheap-api.md10.6 KiB
Requirements and compatibility
Written for: GitHub Copilot
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an API key, Needs Python
Security
What our scanner noticed· Low risk
- Instructions that use the network
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- First committed by
brunoborges
- Publisher
- GitHub (Official)
- Distributed by
- GitHub
- Source
- github/awesome-copilot · skills/namecheap · commit 797337f
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Contributors
- brunoborges
AutoGineer is not affiliated with or endorsed by brunoborges or GitHub.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download namecheap.zip