dns-healthcheck
DNS probe container that dig-checks your resolver and flips healthy only once answers work.
4.7K
Lightweight DNS probe container that reports resolver readiness through Docker healthchecks. Point it at AdGuard Home, Unbound, or any resolver to delay dependent services until valid DNS answers are available.
alpine:3.20 + bind-tools/usr/local/bin/check_dns.sh runs every second via Docker
healthcheckdig +time=1 +tries=1 <DOMAIN> @<DNS_SERVER>dig exit, SERVFAIL, REFUSED, or missing
ANSWER SECTIONlinux/amd64 and linux/arm64| Variable | Default | Purpose |
|---|---|---|
DOMAIN_TO_CHECK | example.com | Domain that must return a valid answer. |
DNS_SERVER | 127.0.0.11 | IP/hostname of the resolver to query. |
INITIAL_DELAY_SECONDS | 0 | Delay before the probe issues its first DNS request. |
FAILURE_COOLDOWN_SECONDS | 0 | Minimum spacing between retries while unhealthy. |
SUCCESS_COOLDOWN_SECONDS | 60 | Minimum spacing between retries after success. |
Set both variables to match your infrastructure. Any failure keeps the
container in unhealthy.
docker run \
--name dns-health \
-e DOMAIN_TO_CHECK=example.org \
-e DNS_SERVER=adguard \
digitaldriveio/dns-healthcheck:snapshot
Check status:
docker inspect --format '{{json .State.Health}}' dns-health
depends_on:
dns-health:
condition: service_healthy
Content type
Image
Digest
sha256:bd608730d…
Size
6.5 MB
Last updated
6 months ago
docker pull digitaldriveio/dns-healthcheck:snapshot