Developer Tools

Automated DNS Updates via Namecheap

Manage domain DNS records through Telegram commands with instant propagation tracking and automated SSL certificate renewal.

Intermediate
10 minutes
Published Feb 2, 2024

Automated DNS Management with Namecheap

Update DNS records from Telegram, track propagation, and never touch cPanel again.

What You'll Build

A DNS management bot that:

  • Updates A, CNAME, TXT records via chat commands
  • Tracks DNS propagation globally
  • Auto-renews SSL certificates when DNS changes
  • Logs all DNS modifications with rollback capability

Requirements

  • Plugins: Namecheap (from Lobstash.ai)
  • Time: 10 minutes
  • Namecheap API: Enable in dashboard

Setup

1. Install Namecheap Plugin

Connect Namecheap account API key: [from namecheap.com/profile/tools/apiaccess] Import all domains

2. Define DNS Commands

Command format: "dns update example.com A @ 192.0.2.1" "dns update example.com CNAME www example.com" "dns update example.com TXT @ v=spf1 include:..." "dns list example.com" "dns check propagation example.com"

3. Add Safety Rules

Before any DNS change: - Show current record - Show proposed change - Ask for confirmation - Log change with timestamp Never auto-delete records without confirmation.

4. Set Up Propagation Tracking

After DNS update: - Check propagation across 8 global DNS servers - Report when 100% propagated (usually 5-30 minutes) - Alert if propagation takes >1 hour

Sample Workflow

You: "dns update myapp.com A @ 192.0.2.50"

Agent:

🔍 Current Record Domain: myapp.com Type: A Host: @ Value: 192.0.2.1 TTL: 3600 📝 Proposed Change Value: 192.0.2.1 → 192.0.2.50 Confirm? Reply YES to update.

You: "YES"

Agent:

✅ DNS Updated Domain: myapp.com Type: A Host: @ New Value: 192.0.2.50 ⏳ Checking propagation... Status: 🟢 Cloudflare: propagated 🟢 Google: propagated 🟡 OpenDNS: pending 🔴 Comcast: old value Estimated full propagation: 15-20 minutes I'll notify you when 100% complete.

15 minutes later:

🎉 DNS Fully Propagated Domain: myapp.com All global DNS servers now serving: 192.0.2.50 Total propagation time: 18 minutes

Pro Tips

  1. Batch Updates: Send multiple updates in one message
  2. Subdomain Wildcard: Set up *.example.com catch-all records
  3. CDN Integration: Auto-update Cloudflare when you change Namecheap DNS
  4. Monitoring: Alert if DNS records change without your command (security)

Manage DNS like a pro → Launch Claws

Ready to try this recipe?

Deploy your Claws agent and start automating in under 2 minutes.

Get Started with Claws

Share this recipe

Recipe Details

Difficulty
Intermediate
Time to Setup
10 minutes
Plugins Used
Tags
#DNS#domains#automation#DevOps