Esta imagen combina Pi‑hole + Unbound en un único contenedor, con optimizaciones avanzadas de rendimiento, caché, seguridad y tiempos de respuesta.
Incluye:
/etc-pihole, /etc-dnsmasq.d y /var/lib/unbound/var/lib/unbound/root.hints127.0.0.1#5335)10000)Gestiona ambos servicios:
unbound -d -c /etc/unbound/unbound.conf/usr/bin/start.sh (Pi-hole FTL)/etc/pihole/etc/dnsmasq.d/var/lib/unboundservices:
pihole-unbound:
container_name: pihole-unbound
image: techcsf/pihole-unbound:latest
hostname: pihole
restart: unless-stopped
networks:
- pi_hole
sysctls:
- net.core.somaxconn=2048
- net.ipv4.tcp_fin_timeout=15
privileged: true
mem_limit: 1024m
mem_reservation: 512m
cpus: "2.0"
ports:
- "53:53/tcp"
- "53:53/udp"
- "8080:80"
volumes:
- ./etc-pihole:/etc/pihole
- ./etc-dnsmasq.d:/etc/dnsmasq.d
- ./unbound:/var/lib/unbound
environment:
TZ: "Europe/Madrid"
WEBPASSWORD: ""
PIHOLE_DNS_1: "127.0.0.1#5335"
PIHOLE_DNS_2: ""
DNSSEC: "false"
DNS_BOGUS_PRIV: "true"
DNS_FQDN_REQUIRED: "true"
BLOCK_IPV6: "false"
FTLCONF_webserver_port: "80"
FTLCONF_dns_cache_size: "10000"
OPTIMIZATION_LEVEL: "high"
UNBOUND_FORWARDERS: ""
healthcheck:
test: ["CMD", "nc", "-z", "127.0.0.1", "5335"]
interval: 60s
timeout: 5s
retries: 3
start_period: 20s
cap_add:
- NET_ADMIN
dns:
- 127.0.0.1
- 1.1.1.1
networks:
pi_hole:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: 1500
| Variable | Valor por defecto | Descripción |
|---|---|---|
TZ | Europe/Madrid | Zona horaria del contenedor. |
WEBPASSWORD | "" | Contraseña del panel web. Vacío = sin contraseña. |
PIHOLE_DNS_1 | 127.0.0.1#5335 | DNS primario de Pi‑hole apuntando a Unbound. |
PIHOLE_DNS_2 | "" | DNS secundario. Se recomienda dejar vacío. |
DNSSEC | false | Debe ser false. Unbound ya valida DNSSEC. |
DNS_BOGUS_PRIV | true | Bloquea rangos privados no válidos. |
DNS_FQDN_REQUIRED | true | Requiere dominios completos (evita consultas locales incorrectas). |
BLOCK_IPV6 | false | Desactiva IPv6 en Pi‑hole. |
FTLCONF_webserver_port | 80 | Puerto interno del servidor web. |
FTLCONF_dns_cache_size | 10000 | Tamaño de la caché DNS de Pi‑hole FTL. |
OPTIMIZATION_LEVEL | high | Ajustes automáticos de rendimiento (low, medium, high). |
UNBOUND_FORWARDERS | "" | Lista de forwarders. Vacío = recursivo puro (recomendado). |
Puedes establecer la contraseña del panel web de Pi‑hole mediante:
WEBPASSWORD="tu_contraseña"
Si lo dejas vacío:
WEBPASSWORD=""
➡️ La interfaz web no pedirá contraseña.
También puedes cambiarla desde dentro del contenedor:
docker exec -it pihole-unbound pihole -a -p
Esta imagen está optimizada para funcionar incluso en hardware limitado, pero se recomiendan:
| Recurso | Recomendado | Mínimo |
|---|---|---|
| RAM | 512–1024 MB | 256 MB |
| CPU | 1–2 cores | 1 core |
| Disco | 200 MB | 100 MB |
En el compose ya se incluyen límites sugeridos:
mem_limit: 1024m
mem_reservation: 512m
cpus: "2.0"
Puedes ajustarlos según tu hardware.
La imagen hereda las arquitecturas soportadas por pihole/pihole, normalmente:
Si tu plataforma está soportada por Pi‑hole, esta imagen funcionará sin cambios.
| Carpeta | Contenido | Persistente |
|---|---|---|
/etc/pihole | Configuración Pi-hole | ✔ |
/etc/dnsmasq.d | Configuración DNS | ✔ |
/var/lib/unbound | Root hints, runtime | ✔ |
Comprueba que Unbound responde en 127.0.0.1:5335.
Soluciones:
docker logs pihole-unboundSoluciones:
docker exec -it pihole-unbound dig @127.0.0.1 -p 5335 google.com/var/lib/unboundroot.hints existeSoluciones:
do-ip6: no en unbound.confdocker exec pihole-unbound wget -O /var/lib/unbound/root.hints https://www.internic.net/domain/named.root
Soluciones:
privileged: trueSolución:
Desactivar DNSSEC en Pi‑hole (DNSSEC=false).
Solución:
Reducir caché en unbound.conf:
msg-cache-size: 16m
rrset-cache-size: 32m
Solución:
Reducir buffers:
so-rcvbuf: 1m
so-sndbuf: 1m
Basado en Pi-hole + Unbound, con optimizaciones adicionales para rendimiento y estabilidad.
Content type
Image
Digest
sha256:8cf04b8c6…
Size
59 MB
Last updated
23 days ago
docker pull techcsf/pihole-unbound:20260629