I’ve migrated my Mailcow docker server to another host. On the old host (Ubuntu 20.04) the Mailcow server was running without any problems. On the new host (Ubuntu 24.0) the renewing of the SSL certificates doesn’t work anymore. The reason is, that the dns lookup for the mail host returns a private address. I can verify this by running the following command:
docker compose exec acme-mailcow nslookup mail.mydomain
it returns:
Server: 127.0.0.11
Address: 127.0.0.11#53
Non-authoritative answer:
Name: mail.mydomain
Address: 172.19.199.204
Name: mail.mydomain
Address: 172.19.199.250
So far as I know, the acme-mailcow container should ask the unbound-mailcow container for the address of the host. If I set explicit the dns server for the nslookup command by running:
docker compose exec acme-mailcow nslookup mail.mydomain unbound-mailcow
I’ll get the correct public IP for mail.mydomain. It is the same answer I’ll get, if I run the nslookup command direct on the host.
Strangely enough, running the nslookup command in the acme-mailcow container for any other host of the domain mydomain without specifying the DNS server will correctly work. I.e.:
docker compose exec acme-mailcow nslookup mydomain
will return the correct public IP.
And even stranger: Also the following call will return the private address instead of the public one:
docker compose exec unbound-mailcow nslookup mail.mydomain
Any ideas how to fix this strange behaviour?
Thanks in advance.