# Send Namecheap DNS to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "namecheap-dns",
    "name": "Namecheap DNS",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/jarekbird/namecheap-dns",
    "canonicalUrl": "https://clawhub.ai/jarekbird/namecheap-dns",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/namecheap-dns",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=namecheap-dns",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "namecheap-dns.js",
      "package-lock.json",
      "package.json"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "namecheap-dns",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-06T00:16:22.764Z",
      "expiresAt": "2026-05-13T00:16:22.764Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=namecheap-dns",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=namecheap-dns",
        "contentDisposition": "attachment; filename=\"namecheap-dns-1.1.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "namecheap-dns"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/namecheap-dns"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/namecheap-dns",
    "downloadUrl": "https://openagent3.xyz/downloads/namecheap-dns",
    "agentUrl": "https://openagent3.xyz/skills/namecheap-dns/agent",
    "manifestUrl": "https://openagent3.xyz/skills/namecheap-dns/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/namecheap-dns/agent.md"
  }
}
```
## Documentation

### Namecheap DNS Management

Safe wrapper around the Namecheap API for DNS operations. Prevents accidental record wipeout by always fetching existing records first and merging changes.

### ⚠️ Why This Skill Exists

The Namecheap API's setHosts method replaces ALL DNS records for a domain. One wrong API call = your entire DNS config is gone. This skill:

✅ Always fetches existing records first
✅ Merges new records with existing ones (unless explicitly replacing)
✅ Shows a diff preview before applying changes
✅ Auto-backups before every change
✅ Supports dry-run mode for safe testing
✅ One-command rollback from backups

### 1. Install dependencies

cd ~/.openclaw/workspace/skills/namecheap-dns
npm install

### 2. Enable Namecheap API access

Go to https://ap.www.namecheap.com/settings/tools/apiaccess/
Toggle "API Access" ON
Whitelist your IP address
Copy your API key

### 3. Set environment variables

Add to ~/.zshrc or ~/.bashrc:

export NAMECHEAP_API_KEY="your-api-key-here"
export NAMECHEAP_USERNAME="your-username"
export NAMECHEAP_API_USER="your-username"  # Usually same as username

### Verify DNS and detect ghost records

⚠️ IMPORTANT: Run this first!

./namecheap-dns.js verify example.com

This command compares DNS records visible to the Namecheap API with actual live DNS records (via dig). It will warn you about "ghost records" that exist in DNS but are invisible to the API (email forwarding, URL redirects, etc.).

### List current DNS records

./namecheap-dns.js list example.com

Note: This only shows records visible to the API. Use verify to see ALL records including those managed by Namecheap subsystems.

### Add records (safe merge)

# Add a single TXT record
./namecheap-dns.js add example.com \\
  --txt "mail.example.com=v=spf1 include:mailgun.org ~all"

# Add multiple records at once
./namecheap-dns.js add example.com \\
  --txt "mail=v=spf1 include:mailgun.org ~all" \\
  --cname "email.mail=mailgun.org" \\
  --mx "mail=10 mxa.mailgun.org"

# Dry-run (preview changes without applying)
./namecheap-dns.js add example.com \\
  --txt "test=hello" \\
  --dry-run

# Force override safety check (if you know ghost records can be deleted)
./namecheap-dns.js add example.com \\
  --txt "test=hello" \\
  --force

Safety: The skill automatically checks for "ghost records" before making changes. If detected, it will refuse to proceed unless you use --force.

### Remove records

# Remove by host + type
./namecheap-dns.js remove example.com \\
  --host "old-record" \\
  --type "TXT"

# Dry-run first
./namecheap-dns.js remove example.com \\
  --host "old-record" \\
  --type "TXT" \\
  --dry-run

### Backup & Restore

# Create manual backup
./namecheap-dns.js backup example.com

# List available backups
./namecheap-dns.js backups example.com

# Restore from latest backup
./namecheap-dns.js restore example.com

# Restore from specific backup
./namecheap-dns.js restore example.com \\
  --backup "example.com-20260213-114500.json"

### TXT Records

--txt "subdomain=value"
--txt "@=value"  # Root domain

### CNAME Records

--cname "subdomain=target.com"

### MX Records

--mx "subdomain=10 mx.target.com"
--mx "@=10 mx.target.com"  # Root domain

### A Records

--a "subdomain=192.168.1.1"
--a "@=192.168.1.1"  # Root domain

### Backup Location

Default: ./backups/ (relative to skill directory)

Configurable via environment variable:

export NAMECHEAP_BACKUP_DIR="/custom/path/to/backups"

Format: {domain}-{timestamp}.json

Each backup includes:

apiHosts: Records visible to Namecheap API
liveDNS: Actual DNS records captured via dig
Timestamp and domain metadata

This allows you to see what was ACTUALLY live in DNS, not just what the API knew about.

### Safety Features

Ghost record detection — automatic check for records invisible to API
Auto-backup before changes — every add or remove creates a timestamped backup (includes DNS snapshot)
Dry-run mode — --dry-run shows what will change without applying
Diff preview — see exactly what records will be added/removed
Fetch-first — always gets current DNS state before changes
Merge logic — adds to existing records instead of replacing
Rollback — one command to restore from backup
Safety override — --force flag for when you need to bypass ghost record warnings

### Mailgun Setup

./namecheap-dns.js add menuhq.ai \\
  --txt "mail.menuhq.ai=v=spf1 include:mailgun.org ~all" \\
  --txt "smtp._domainkey.mail.menuhq.ai=k=rsa; p=MIGfMA0..." \\
  --txt "_dmarc.mail.menuhq.ai=v=DMARC1; p=quarantine;" \\
  --cname "email.mail.menuhq.ai=mailgun.org" \\
  --mx "mail.menuhq.ai=10 mxa.mailgun.org" \\
  --mx "mail.menuhq.ai=20 mxb.mailgun.org" \\
  --dry-run

Review the diff, then run without --dry-run to apply.

### ⚠️ The Namecheap API is Destructive

The Namecheap domains.dns.setHosts API method replaces ALL DNS records for a domain. There is no "add one record" or "update one record" endpoint. Every change requires:

Fetch all existing records (getHosts)
Modify the list
Upload the entire list (setHosts)

This skill handles this for you by always fetching first and merging changes.

### 🔍 Ghost Records: The Hidden Danger

Problem: domains.dns.getHosts does NOT return all DNS records. Records managed by Namecheap subsystems are invisible to the API:

Email Forwarding — MX, SPF, and DKIM records
URL Redirect — A/CNAME records for domain parking/redirects
Third-party integrations — Records added through Namecheap's dashboard for services

Since setHosts replaces all records, using the API can silently delete these hidden records.

### 🛡️ How This Skill Protects You

verify command — Compares API records with actual live DNS (via dig) and warns about ghost records
Automatic safety check — Before any add, remove, or restore, the skill checks for ghost records
Refuses to proceed — If ghost records are detected, the operation is blocked (unless --force is used)
Clear warnings — Shows exactly which records will be lost if you proceed
DNS snapshots in backups — Captures actual DNS state via dig, not just API state

### When to Use --force

Only use the --force flag when:

You've manually verified the ghost records are no longer needed
You're intentionally removing email forwarding or URL redirects
You understand and accept that those records will be deleted

Never use --force blindly. Always run verify first to see what will be lost.

### Example: The Production Incident

This skill was created after adding Mailgun DNS records via the API wiped out Namecheap's email forwarding records. The email forwarding MX/SPF/TXT records were invisible to getHosts, so the fetch-merge-write pattern deleted them.

Now, the skill would have:

Detected the ghost records during verify
Refused to proceed without --force
Shown exactly which email forwarding records would be deleted
Created a backup including the DNS snapshot

### "API request failed: IP not whitelisted"

Add your current IP to https://ap.www.namecheap.com/settings/tools/apiaccess/
Check with: curl ifconfig.me

### "Invalid API key"

Verify NAMECHEAP_API_KEY is set correctly
Re-enable API access if needed

### "Domain not found"

Ensure domain is in your Namecheap account
Check spelling (case-sensitive)

### API Reference

Namecheap API docs: https://www.namecheap.com/support/api/methods/domains-dns/
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: jarekbird
- Version: 1.1.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-06T00:16:22.764Z
- Expires at: 2026-05-13T00:16:22.764Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/namecheap-dns)
- [Send to Agent page](https://openagent3.xyz/skills/namecheap-dns/agent)
- [JSON manifest](https://openagent3.xyz/skills/namecheap-dns/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/namecheap-dns/agent.md)
- [Download page](https://openagent3.xyz/downloads/namecheap-dns)