---
name: analyze_dns
kind: function
lang: bash
domain: cybersecurity
version: "1.0.0"
purity: impure
signature: "analyze_dns(domain: string, mode: string) -> void"
description: "Análisis DNS completo de un dominio: registros A/AAAA/MX/NS/TXT/CNAME/SOA, consulta whois y verificación contra listas negras DNSBL (spamhaus, spamcop, sorbs, barracuda)."
tags: [bash, cybersecurity, dns, network, whois, dnsbl, reconnaissance]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: "error_go_core"
imports: []
params:
  - name: domain
    desc: "dominio a analizar, ej: example.com"
  - name: mode
    desc: "modo de análisis: records (solo registros DNS), whois (solo whois), dnsbl (solo listas negras) o all (todo, por defecto)"
output: "imprime registros DNS, información whois y estado DNSBL a stdout con colores ANSI"
tested: false
tests: []
test_file_path: ""
file_path: "bash/functions/cybersecurity/analyze_dns.sh"
source_repo: "https://gitea-dgg044oo04woo4ggcsws4gk0.organic-machine.com/egutierrez/DevLauncher.git"
source_license: "MIT"
source_file: "scripts/linux/ciberseguridad/redes/analisis_dns.sh"
---

## Ejemplo

```bash
source bash/functions/cybersecurity/analyze_dns.sh

# Análisis completo
analyze_dns example.com

# Solo registros DNS
analyze_dns example.com records

# Solo whois
analyze_dns example.com whois

# Solo DNSBL
analyze_dns example.com dnsbl
```

## Notas

Requiere `dig` (paquete dnsutils). `whois` es opcional — si no está instalado y el modo es `all`, se omite el paso whois con aviso. Las listas negras DNSBL se consultan via DNS inverso (técnica estándar sin HTTP). El modo `dnsbl` resuelve primero la IP del dominio y luego construye la consulta invertida para cada blacklist.
