---
name: "NameSilo Domain API"
description: "Skill for NameSilo Domain API — auto-generated from documentation"
version: "1.0.0"
author: "skynet"
category: "infrastructure"
agents: ["claude-code", "codex", "gemini"]
tags: ["namesilo-api", "infrastructure", "auto-generated"]
---

# NameSilo Domain API

---
name: NameSilo Domain API
description: Use when you need to manage domain registrations, DNS records, and domain operations programmatically through NameSilo's API. Perfect for automating domain workflows, bulk operations, and integrating domain management into applications.
metadata:
  author: skynet
  version: 1.0.0
category: infrastructure
---

# NameSilo Domain API

## Core Operations

### Authentication Setup
```bash
# Set API key as environment variable
export NAMESILO_API_KEY="your_api_key_here"

# Test API connection
curl "https://www.namesilo.com/api/getAccountBalance?version=1&type=xml&key=${NAMESILO_API_KEY}"
```

### Domain Registration
```bash
# Check domain availability
curl "https://www.namesilo.com/api/checkRegisterAvailability?version=1&type=xml&key=${NAMESILO_API_KEY}&domains=example.com,example.net"

# Register a domain
curl -X POST "https://www.namesilo.com/api/registerDomain" \
  -d "version=1" \
  -d "type=xml" \
  -d "key=${NAMESILO_API_KEY}" \
  -d "domain=example.com" \
  -d "years=1" \
  -d "private=1" \
  -d "auto_renew=1"

# Register with custom nameservers
curl -X POST "https://www.namesilo.com/api/registerDomain" \
  -d "version=1" \
  -d "type=xml" \
  -d "key=${NAMESILO_API_KEY}" \
  -d "domain=example.com" \
  -d "years=2" \
  -d "ns1=ns1.example.com" \
  -d "ns2=ns2.example.com" \
  -d "private=1"
```

### Domain Management
```bash
# List all domains
curl "https://www.namesilo.com/api/listDomains?version=1&type=xml&key=${NAMESILO_API_KEY}"

# Get domain info
curl "https://www.namesilo.com/api/getDomainInfo?version=1&type=xml&key=${NAMESILO_API_KEY}&domain=example.com"

# Renew domain
curl -X POST "https://www.namesilo.com/api/renewDomain" \
  -d "version=1" \
  -d "type=xml" \
  -d "key=${NAMESILO_API_KEY}" \
  -d "domain=example.com" \
  -d "years=1"

# Transfer domain
curl -X POST "https://www.namesilo.com/api/transferDomain" \
  -d "version=1" \
  -d "type=xml" \
  -d "key=${NAMESILO_API_KEY}" \
  -d "domain=example.com" \
  -d "auth=AUTH_CODE_HERE" \
  -d "private=1"
```

## DNS Record Management

### Basic DNS Operations
```bash
# List DNS records
curl "https://www.namesilo.com/api/dnsListRecords?version=1&type=xml&key=${NAMESILO_API_KEY}&domain=example.com"

# Add A record
curl -X POST "https://www.namesilo.com/api/dnsAddRecord" \
  -d "version=1" \
  -d "type=xml" \
  -d "key=${NAMESILO_API_KEY}" \
  -d "domain=example.com" \
  -d "rrtype=A" \
  -d "rrhost=www" \
  -d "rrvalue=192.168.1.100" \
  -d "rrttl=3600"

# Add CNAME record
curl -X POST "https://www.namesilo.com/api/dnsAddRecord" \
  -d "version=1" \
  -d "type=xml" \
  -d "key=${NAMESILO_API_KEY}" \
  -d "domain=example.com" \
  -d "rrtype=CNAME" \
  -d "rrhost=blog" \
  -d "rrvalue=example.com" \
  -d "rrttl=7200"

# Update DNS record (requires record ID)
curl -X POST "https://www.namesilo.com/api/dnsUpdateRecord" \
  -d "version=1" \
  -d "type=xml" \
  -d "key=${NAMESILO_API_KEY}" \
  -d "domain=example.com" \
  -d "rrid=RECORD_ID" \
  -d "rrhost=www" \
  -d "rrvalue=192.168.1.101" \
  -d "rrttl=3600"

# Delete DNS record
curl -X POST "https://www.namesilo.com/api/dnsDeleteRecord" \
  -d "version=1" \
  -d "type=xml" \
  -d "key=${NAMESILO_API_KEY}" \
  -d "domain=example.com" \
  -d "rrid=RECORD_ID"
```

### Nameserver Management
```bash
# List current nameservers
curl "https://www.namesilo.com/api/getDomainInfo?version=1&type=xml&key=${NAMESILO_API_KEY}&domain=example.com"

# Change nameservers
curl -X POST "https://www.namesilo.com/api/changeNameServers" \
  -d "version=1" \
  -d "type=xml" \
  -d "key=${NAMESILO_API_KEY}" \
  -d "domain=example.com" \
  -d "ns1=ns1.newprovider.com" \
  -d "ns2=ns2.newprovider.com"

# Register nameserver
curl -X POST "https://www.namesilo.com/api/registerNameServer" \
  -d "version=1" \
  -d "type=xml" \
  -d "key=${NAMESILO_API_KEY}" \
  -d "domain=example.com" \
  -d "new_host=ns1.example.com" \
  -d "ip=192.168.1.10"
```

## Decision Trees

### Domain Registration Workflow
```
Need to register domain?
├── Check availability first
│   ├── Available? → Proceed with registration
│   └── Not available? → Try variations or different TLD
├── Choose registration length
│   ├── 1 year (standard)
│   ├── 2-10 years (bulk discount)
│   └── Auto-renew enabled?
└── Privacy protection needed?
    ├── Yes → Set private=1
    └── No → Set private=0
```

### DNS Management Strategy
```
DNS changes needed?
├── Simple A/CNAME records?
│   ├── Use NameSilo DNS → Add records via API
│   └── External DNS → Change nameservers
├── Complex setup (load balancing, etc.)?
│   └── Use external DNS provider
└── Email hosting?
    ├── MX records needed → Add via dnsAddRecord
    └── Use NameSilo email → Default MX records
```

## Common Workflows

### Bulk Domain Registration
```bash
#!/bin/bash
# Bulk register domains from file

DOMAINS_FILE="domains.txt"
NAMESILO_API_KEY="your_api_key"

while read domain; do
    echo "Registering $domain..."
    curl -X POST "https://www.namesilo.com/api/registerDomain" \
        -d "version=1" \
        -d "type=xml" \
        -d "key=${NAMESILO_API_KEY}" \
        -d "domain=$domain" \
        -d "years=1" \
        -d "private=1" \
        -d "auto_renew=1"
    sleep 2  # Rate limiting
done < "$DOMAINS_FILE"
```

### DNS Record Migration
```bash
#!/bin/bash
# Migrate DNS records to new IP

OLD_IP="192.168.1.100"
NEW_IP="192.168.1.200"
DOMAIN="example.com"

# Get all DNS records
records=$(curl -s "https://www.namesilo.com/api/dnsListRecords?version=1&type=xml&key=${NAMESILO_API_KEY}&domain=${DOMAIN}")

# Parse and update A records (requires XML parsing)
# This is a simplified example - use proper XML parsing in production
echo "Manual review required for record updates"
curl "https://www.namesilo.com/api/dnsListRecords?version=1&type=xml&key=${NAMESILO_API_KEY}&domain=${DOMAIN}"
```

### Domain Expiry Monitoring
```bash
#!/bin/bash
# Check domain expiry dates

curl -s "https://www.namesilo.com/api/listDomains?version=1&type=xml&key=${NAMESILO_API_KEY}" | \
grep -E "(domain|expires)" | \
while read line; do
    echo "$line"
done
```

## Troubleshooting

### Authentication Issues
```
Error: "Invalid API Key"
Fix: Verify API key in NameSilo account settings
→ curl "https://www.namesilo.com/api/getAccountBalance?version=1&type=xml&key=YOUR_KEY"

Error: "API key not found"
Fix: Ensure API key is properly URL encoded
→ Use %20 for spaces, %40 for @, etc.
```

### Domain Registration Errors
```
Error: "Domain not available"
Fix: Check availability first
→ curl "https://www.namesilo.com/api/checkRegisterAvailability?..."

Error: "Insufficient funds"
Fix: Add funds to account or check pricing
→ curl "https://www.namesilo.com/api/getAccountBalance?..."

Error: "Invalid domain name"
Fix: Ensure domain follows RFC standards
→ Check for special characters, length limits
```

### DNS Record Issues
```
Error: "Record ID not found"
Fix: Get current record ID first
→ curl "https://www.namesilo.com/api/dnsListRecords?..."

Error: "Invalid TTL value"
Fix: Use valid TTL range (300-86400 seconds)
→ Common values: 300, 3600, 7200, 86400

Error: "Duplicate record"
Fix: Check existing records before adding
→ Delete old record first or update existing
```

### Rate Limiting
```
Error: "Too many requests"
Fix: Implement delays between requests
→ Add sleep 2 between API calls
→ Use bulk operations where available
→ Cache responses when possible
```

### API Response Issues
```
Error: "Malformed XML response"
Fix: Check API endpoint and parameters
→ Ensure all required parameters are included
→ Verify parameter names and values
→ Use POST for write operations

Error: "Connection timeout"
Fix: Implement retry logic
→ Use curl with --retry flag
→ Add connection timeout: --connect-timeout 30
```
