Generated banner for Namecheap
Generated logo for Namecheap

Namecheap

GitHubOfficialFirst committed by brunoborgesDistributed by GitHub

  • Skill
  • Tool integration
  • Automation and integrations
  • MIT
  • Low risk
  • Has scripts

From the author

Manage DNS records for domains registered with Namecheap via their API. List domains, view/add/update/remove DNS host entries (A, AAAA, CNAME, MX, TXT, etc.), and guide users through API setup including public IP detection and credential configuration. Use when the user mentions Namecheap, DNS records, domain management, or wants to add/change/remove A records, CNAME records, MX records, or TXT records for their domains.
— the description by brunoborges

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

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/github/namecheap/download
  2. Unzip 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:

  1. Check for existing config — look for ~/.namecheap-api

  2. If not configured, guide the user through setup: a. Show public IP — run python3 namecheap.py public-ip to 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 run python3 namecheap.py setup directly in their own terminal. The script prompts for the username and reads the API key with a hidden prompt (getpass), writes ~/.namecheap-api with chmod 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 run setup themselves, or to export NAMECHEAP_API_USER and NAMECHEAP_API_KEY as environment variables in their own shell — rather than collecting the secret via ask_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.8
JSON 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-api exists 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_user to confirm destructive changes. Before removing records or replacing all records with setHosts, confirm with the user.

  • The Namecheap setHosts API replaces ALL records. Never call domains.dns.setHosts directly unless you have fetched all existing records first. Use dns.addHost and dns.removeHost for 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.uk have 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 a 2019166 ("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

references/namecheap-api.md

Namecheap API Reference

Base URL

https://api.namecheap.com/xml.response

Authentication

All requests require these common parameters:

ParameterDescription
ApiUserNamecheap username
ApiKeyAPI key from https://ap.www.namecheap.com/settings/tools/apiaccess/
UserNameSame as ApiUser
ClientIpThe whitelisted public IP address of the client
CommandThe API command prefixed with namecheap.

Setup Requirements

  1. Log in to Namecheap

  2. Go to https://ap.www.namecheap.com/settings/tools/apiaccess/

  3. Enable API Access (toggle to ON)

  4. Add the client's public IP address to the whitelist

  5. Copy the generated API key

Commands


namecheap.domains.getList

Lists all domains in the account.

Additional Parameters:

ParameterRequiredDescription
ListTypeNoALL (default), EXPIRING, or EXPIRED
SearchTermNoKeyword to filter domains
PageNoPage number (default: 1)
PageSizeNoResults per page, 10-100 (default: 20)
SortByNoNAME, NAME_DESC, EXPIREDATE, EXPIREDATE_DESC, CREATEDATE, CREATEDATE_DESC

Response XML:

<ApiResponse Status="OK">
  <CommandResponse Type="namecheap.domains.getList">
    <DomainGetListResult>
      <Domain ID="123" Name="example.com" User="user" Created="01/01/2020"
        Expires="01/01/2025" IsExpired="false" IsLocked="true" AutoRenew="true"
        WhoisGuard="ENABLED" />
    </DomainGetListResult>
    <Paging><TotalItems>5</TotalItems><CurrentPage>1</CurrentPage><PageSize>20</PageSize></Paging>
  </CommandResponse>
</ApiResponse>

namecheap.domains.dns.getList

Gets the list of DNS servers associated with a domain (shows whether it uses Namecheap DNS or custom nameservers).

Additional Parameters:

ParameterRequiredDescription
SLDYesSecond-level domain (e.g., example for example.com)
TLDYesTop-level domain (e.g., com for example.com)

Response XML:

<ApiResponse Status="OK">
  <CommandResponse Type="namecheap.domains.dns.getList">
    <DomainDNSGetListResult Domain="example.com" IsUsingOurDNS="true">
      <Nameserver>dns1.registrar-servers.com</Nameserver>
      <Nameserver>dns2.registrar-servers.com</Nameserver>
    </DomainDNSGetListResult>
  </CommandResponse>
</ApiResponse>

namecheap.domains.dns.getHosts

Gets DNS host records for a domain.

Additional Parameters:

ParameterRequiredDescription
SLDYesSecond-level domain (e.g., example for example.com)
TLDYesTop-level domain (e.g., com for example.com)

Response XML:

<ApiResponse Status="OK">
  <CommandResponse Type="namecheap.domains.dns.getHosts">
    <DomainDNSGetHostsResult Domain="example.com" IsUsingOurDNS="true">
      <host HostId="1" Name="@" Type="A" Address="1.2.3.4" MXPref="0" TTL="1800" />
      <host HostId="2" Name="www" Type="CNAME" Address="example.com." MXPref="0" TTL="1800" />
      <host HostId="3" Name="@" Type="MX" Address="mail.example.com." MXPref="10" TTL="1800" />
      <host HostId="4" Name="@" Type="TXT" Address="v=spf1 include:_spf.google.com ~all" MXPref="0" TTL="1800" />
    </DomainDNSGetHostsResult>
  </CommandResponse>
</ApiResponse>

namecheap.domains.dns.setHosts

Sets (replaces) all DNS host records for a domain.

IMPORTANT: This command replaces ALL existing records. Always fetch existing records first.

Additional Parameters:

ParameterRequiredDescription
SLDYesSecond-level domain
TLDYesTop-level domain
HostNameNYesHost name for record N (e.g., @, www, mail)
RecordTypeNYesRecord type for record N (A, AAAA, CNAME, MX, TXT, etc.)
AddressNYesValue for record N (IP address or target hostname)
MXPrefNNoMX priority for record N (required for MX records)
TTLNNoTTL in seconds for record N (default: 1800)

Records are numbered starting from 1: HostName1, RecordType1, Address1, HostName2, RecordType2, Address2, etc.

Response XML:

<ApiResponse Status="OK">
  <CommandResponse Type="namecheap.domains.dns.setHosts">
    <DomainDNSSetHostsResult Domain="example.com" IsSuccess="true" />
  </CommandResponse>
</ApiResponse>

namecheap.domains.dns.setDefault

Sets a domain to use Namecheap's default DNS servers.

Additional Parameters:

ParameterRequiredDescription
SLDYesSecond-level domain
TLDYesTop-level domain

Response XML:

<ApiResponse Status="OK">
  <CommandResponse Type="namecheap.domains.dns.setDefault">
    <DomainDNSSetDefaultResult Domain="example.com" Updated="true" />
  </CommandResponse>
</ApiResponse>

namecheap.domains.dns.setCustom

Sets a domain to use custom nameservers (e.g., Cloudflare, Route53).

Additional Parameters:

ParameterRequiredDescription
SLDYesSecond-level domain
TLDYesTop-level domain
NameserversYesComma-separated list of nameservers (max 12, no spaces)

Example: Nameservers=ns1.cloudflare.com,ns2.cloudflare.com

Response XML:

<ApiResponse Status="OK">
  <CommandResponse Type="namecheap.domains.dns.setCustom">
    <DomainDNSSetCustomResult Domain="example.com" Updated="true" />
  </CommandResponse>
</ApiResponse>

namecheap.domains.dns.getEmailForwarding

Gets email forwarding settings for a domain.

Additional Parameters:

ParameterRequiredDescription
DomainNameYesFull domain name (e.g., example.com)

Response XML:

<ApiResponse Status="OK">
  <CommandResponse Type="namecheap.domains.dns.getEmailForwarding">
    <DomainDNSGetEmailForwardingResult Domain="example.com">
      <Forward mailboxid="1" mailbox="info" ForwardTo="[email protected]" />
      <Forward mailboxid="2" mailbox="support" ForwardTo="[email protected]" />
    </DomainDNSGetEmailForwardingResult>
  </CommandResponse>
</ApiResponse>

namecheap.domains.dns.setEmailForwarding

Sets email forwarding for a domain. Replaces all existing forwarding rules.

Additional Parameters:

ParameterRequiredDescription
DomainNameYesFull domain name (e.g., example.com)
MailBoxNYesMailbox name for rule N (e.g., info, support)
ForwardToNYesDestination email for rule N

Rules are numbered starting from 1: MailBox1, ForwardTo1, MailBox2, ForwardTo2, etc. Omitting all MailBox/ForwardTo parameters deletes all forwarding rules.

Response XML:

<ApiResponse Status="OK">
  <CommandResponse Type="namecheap.domains.dns.setEmailForwarding">
    <DomainDNSSetEmailForwardingResult Domain="example.com" IsSuccess="true" />
  </CommandResponse>
</ApiResponse>

namecheap.domains.ns.create

Creates a child nameserver (glue record) for a domain.

Additional Parameters:

ParameterRequiredDescription
SLDYesSecond-level domain
TLDYesTop-level domain
NameserverYesNameserver hostname to create (e.g., ns1.example.com)
IPYesIP address for the nameserver

Response XML:

<ApiResponse Status="OK">
  <CommandResponse Type="namecheap.domains.ns.create">
    <DomainNSCreateResult Domain="example.com" Nameserver="ns1.example.com" IP="1.2.3.4" IsSuccess="true" />
  </CommandResponse>
</ApiResponse>

namecheap.domains.ns.delete

Deletes a child nameserver.

Additional Parameters:

ParameterRequiredDescription
SLDYesSecond-level domain
TLDYesTop-level domain
NameserverYesNameserver hostname to delete

Response XML:

<ApiResponse Status="OK">
  <CommandResponse Type="namecheap.domains.ns.delete">
    <DomainNSDeleteResult Domain="example.com" Nameserver="ns1.example.com" IsSuccess="true" />
  </CommandResponse>
</ApiResponse>

namecheap.domains.ns.getInfo

Gets information about a child nameserver.

Additional Parameters:

ParameterRequiredDescription
SLDYesSecond-level domain
TLDYesTop-level domain
NameserverYesNameserver hostname to query

Response XML:

<ApiResponse Status="OK">
  <CommandResponse Type="namecheap.domains.ns.getInfo">
    <DomainNSInfoResult Domain="example.com" Nameserver="ns1.example.com" IP="1.2.3.4">
      <NameserverStatuses>
        <Status>OK</Status>
      </NameserverStatuses>
    </DomainNSInfoResult>
  </CommandResponse>
</ApiResponse>

namecheap.domains.ns.update

Updates the IP address of a child nameserver.

Additional Parameters:

ParameterRequiredDescription
SLDYesSecond-level domain
TLDYesTop-level domain
NameserverYesNameserver hostname to update
OldIPYesCurrent IP address of the nameserver
IPYesNew IP address for the nameserver

Response XML:

<ApiResponse Status="OK">
  <CommandResponse Type="namecheap.domains.ns.update">
    <DomainNSUpdateResult Domain="example.com" Nameserver="ns1.example.com" IsSuccess="true" />
  </CommandResponse>
</ApiResponse>

Error Responses

<ApiResponse Status="ERROR">
  <Errors>
    <Err Code="2019166">Domain not found</Err>
  </Errors>
</ApiResponse>

Common error codes:

  • 1011102 — Invalid API key

  • 1011148 — IP not whitelisted

  • 2019166 — Domain not found

  • 2016166 — Domain not using Namecheap DNS

Record Types

TypeDescriptionAddress Format
AIPv4 address1.2.3.4
AAAAIPv6 address2001:db8::1
CNAMECanonical nametarget.example.com.
MXMail exchangemail.example.com. (requires MXPref)
MXEMX equivalent (IP)1.2.3.4
TXTText recordAny text value
URLURL redirect (unmasked)http://example.com
URL301Permanent redirecthttp://example.com
FRAMEURL redirect (masked)http://example.com

TTL Values

SecondsHuman Readable
601 minute
3005 minutes
180030 minutes (default)
36001 hour
144004 hours
4320012 hours
864001 day

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
GitHub avatar of brunoborgesbrunoborges
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