Dns

From tinh2/skills-hub-registry · View interactive version

Dns is an AI agent skill from the GitHub repository tinh2/skills-hub-registry. Set up DNS records, SSL/TLS certificates, subdomains, SPF/DKIM/DMARC email authentication, and health-check failover routing for Route53, Cloudflare, or GCP Cloud DNS — with optional Terraform output

How to use this skill

Skill file

You are in AUTONOMOUS MODE. Do NOT ask questions. Do NOT pause for confirmation.

Execute every phase below in sequence, making decisions based on what you find.

============================================================

PHASE 0 — INPUT

============================================================

$ARGUMENTS may contain:

============================================================

PHASE 1 — CURRENT STATE ANALYSIS

============================================================

Scan the project for existing DNS configuration:

Terraform DNS resources:

Application config:

Infrastructure references:

SSL/TLS certificates:

Compile a list of:

============================================================

PHASE 2 — DNS RECORD GENERATION

============================================================

Generate DNS records for all required domains. Organize by record type:

Root domain (example.com):

A     example.com    ->  {load balancer IP or CDN}
AAAA  example.com    ->  {IPv6 address if available}

Standard subdomains (if --subdomains):

| Subdomain | Record | Target | Purpose |

|-----------|--------|--------|---------|

| www | CNAME | example.com | www redirect |

| api | CNAME | ALB/Cloud Run/API Gateway | API endpoint |

| app | CNAME | CDN/Vercel/Netlify | Frontend app |

| cdn | CNAME | CloudFront/Cloudflare | Static assets |

| staging | CNAME | Staging environment | Pre-production |

| docs | CNAME | GitHub Pages/Gitbook | Documentation |

| status | CNAME | Status page provider | Uptime monitoring |

| mail | MX/CNAME | Email provider | Mail routing |

Terraform format (if --terraform):

Generate Route53, Cloudflare, or GCP Cloud DNS resources based on detected provider. Include:

Cloudflare specifics:

GCP Cloud DNS specifics:

============================================================

PHASE 3 — SSL/TLS CERTIFICATE SETUP

============================================================

Configure SSL certificates for all domains:

AWS ACM:

Cloudflare:

Let's Encrypt (self-hosted):

============================================================

PHASE 4 — EMAIL DNS (if --email)

============================================================

Configure email authentication records to prevent spoofing:

SPF (Sender Policy Framework):

TXT  example.com  "v=spf1 include:_spf.google.com include:amazonses.com ~all"

DKIM (DomainKeys Identified Mail):

DMARC (Domain-based Message Authentication):

TXT  _dmarc.example.com  "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com; ruf=mailto:dmarc@example.com; pct=100"

MX records (mail routing):

Additional email records:

============================================================

PHASE 5 — HEALTH CHECK ROUTING (if --health-check)

============================================================

Set up DNS-level health checks for failover or latency-based routing:

AWS Route53 health checks:

Cloudflare load balancing:

Latency-based routing (multi-region):

============================================================

PHASE 6 — VALIDATION

============================================================

After generating configuration, verify:

  1. No conflicting records — check for duplicate A/CNAME on same name
  2. CNAME restrictions — CNAME cannot coexist with other record types on same name
  3. TTL values — production records should use reasonable TTLs (300-3600s)
  4. Missing records — warn if www redirect, SSL validation records, or MX records are absent
  5. DNSSEC — recommend enabling if provider supports it

============================================================

SELF-HEALING VALIDATION (max 2 iterations)

============================================================

After completing deployment/infrastructure changes, validate:

  1. Verify all generated files are syntactically valid (YAML, JSON, HCL, Dockerfile).
  2. Run validation commands if available (terraform validate, docker build --check, kubectl dry-run).
  3. Verify no secrets, credentials, or sensitive values are hardcoded.
  4. If validation fails, diagnose and fix the specific syntax or config error.
  5. Repeat up to 2 iterations.

IF STILL FAILING after 2 iterations:

============================================================

OUTPUT

============================================================

## DNS Configuration Complete

### Domain: {domain}
### Provider: {provider}

### Records Generated
| Type | Name | Value | TTL | Notes |
|------|------|-------|-----|-------|
| A | {domain} | {target} | 300 | Root domain |
| CNAME | www | {domain} | 300 | www redirect |
| CNAME | api | {alb/origin} | 300 | API endpoint |
| TXT | {domain} | v=spf1... | 3600 | SPF |
| TXT | _dmarc | v=DMARC1... | 3600 | DMARC |

### SSL/TLS
- Certificate: {ACM/Cloudflare/Let's Encrypt}
- Coverage: {domain}, *.{domain}
- Auto-renewal: {yes/no}

### Files Created
{list of files}

### Nameservers (if new zone)
{ns1, ns2, ns3, ns4 — update at registrar}

============================================================

NEXT STEPS

============================================================

  1. If new zone: update nameservers at your domain registrar
  2. Wait for DNS propagation (up to 48 hours, usually minutes)
  3. Verify records: dig +short example.com A and dig +short example.com MX
  4. Verify SSL: curl -vI https://example.com 2>&1 | grep 'SSL certificate'
  5. Test email authentication: send test email and check headers for SPF/DKIM/DMARC pass
  6. Set up monitoring for DNS resolution and certificate expiration
  7. If using DMARC with p=none, monitor reports for 2 weeks then tighten to p=quarantine

============================================================

SELF-EVOLUTION TELEMETRY

============================================================

After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

Entry format:

### /dns — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}

Only log if the memory directory exists. Skip silently if not found.

Keep entries concise — /evolve will parse these for skill improvement signals.

============================================================

DO NOT

============================================================

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.