返回 Skill 列表
extension
分类: 开发与工程无需 API Key

loopia-dns

通过XML-RPC API管理Loopia DNS,包括列出账户下的域名和子域名以及在Loopia区域中列出、添加、更新和删除DNS记录。当用户提到Loopia DNS、Loopia API、子域名、域名或A/CNAME/TXT/MX记录更改时使用此功能。

person作者: jakexiaohubgithub

Loopia DNS

Use this skill to manage Loopia DNS through the XML-RPC API endpoint https://api.loopia.se/RPCSERV.

Quick Start

1) Configure credentials

Add credentials to ~/.config/ehh-skills/config.env:

mkdir -p ~/.config/ehh-skills
cat >> ~/.config/ehh-skills/config.env <<'EOF'
LOOPIA_USER="<your-loopia-user>"
LOOPIA_PASSWORD="<your-loopia-password>"
# Optional
# LOOPIA_CUSTOMER="customer-id"
EOF

The CLI auto-loads this file. Environment variables also work:

export LOOPIA_USER="<your-loopia-user>"
export LOOPIA_PASSWORD="<your-loopia-password>"

Optional (if your API user manages another account):

export LOOPIA_CUSTOMER="customer-id"

2) Use the bundled CLI helper

Run the helper from the skill directory:

# List domains on the account
python scripts/loopia_dns_cli.py list-domains

# List subdomains in a zone
python scripts/loopia_dns_cli.py list-subdomains example.com

# List records on a subdomain (use @ for zone apex)
python scripts/loopia_dns_cli.py list-records example.com --subdomain www

# List all A records in a zone
python scripts/loopia_dns_cli.py list-a-records example.com

# Add a DNS record
python scripts/loopia_dns_cli.py add-record example.com www A 203.0.113.10 --ttl 300

# Update a record by record_id
python scripts/loopia_dns_cli.py update-record example.com www 123456 A 203.0.113.20 --ttl 300

# Delete a record by record_id
python scripts/loopia_dns_cli.py delete-record example.com www 123456

Workflow

  1. Validate zone and subdomain from user request.
  2. Start with list-a-records for quick A-record audits, or list-subdomains + list-records for full inspection.
  3. For changes, target a specific record_id.
  4. Re-read records to verify result.
  5. Report changes in a short before/after style.

Common Operations

  • List current DNS: list-records
  • List all A records: list-a-records
  • Create record: add-record
  • Edit record: update-record with known record_id
  • Remove record: delete-record with known record_id

Notes

  • Apex/root often uses subdomain @.
  • TTL is in seconds.
  • Loopia propagation can take minutes (sometimes up to around 15 minutes).
  • Required Loopia API permissions are documented in references/loopia_api.md.
  • Preferred config location: ~/.config/ehh-skills/config.env.

Files

  • CLI helper: scripts/loopia_dns_cli.py
  • API notes: references/loopia_api.md