@pkernstock
To clarify:
Without a forward-zone:
docker compose up -d leads to
✘ Container mailcowdockerized-unbound-mailcow-1 Error
dependency failed to start: container mailcowdockerized-unbound-mailcow-1 is unhealthy
and:
docker compose exec unbound-mailcow /bin/bash enters the container. Inside the container ping, dig and nslookup are working. Therefore I assume DNS is working.
Defining a forward-zone to the opnsense leads to a healthy start of the unbound-container (all containers). No errors at all.
Inside the container:
nslookup fuzzy.mailcow.email
Server: 127.0.0.11
Address: 127.0.0.11#53
Non-authoritative answer:
Name: fuzzy.mailcow.email
Address: 95.217.129.125
less healthcheck.sh:
for domain in “${domains[@]}” ; do
success=false
for ((i=1; i<=3; i++)); do
dig_output=$(dig +short +timeout=2 +tries=1 “$domain” @127.0.0.1 2>/dev/null)
dig_rc=$?
if [ $dig_rc -ne 0 ] || [ -z "$dig_output" ]; then
log_to_stdout "Healthcheck: DNS Resolution Failed on attempt $i for $domain! Trying again..."
else
success=true
break
fi
done
Testing:
1.) dig +short +timeout=2 +tries=1 fuzzy.mailcow.email @127.0.0.1 is giving nothing back
2.) dig +short +timeout=2 +tries=1 fuzzy.mailcow.email @127.0.0.11
95.217.129.125
Altering healthcheck.sh inside the container will not persist a restart.