I have a server with two IP addresses, ip1 and an additional ip2.
Let’s just say for example ip1=89.47.47.47.47 and ip2=89.50.50.50.50
DNS: domain.com is mapped to ip1, and mail.domain.com is mapped to ip2.
My Apache2 web server is listening on ip1, while I have mailcow running on ip2.
I have modified/adjusted the following files:
mailcow.conf:
HTTP_PORT=80
HTTP_BIND=ip2
HTTPS_PORT=443
HTTPS_BIND=ip2
hosts file added:
ip2 mail.domain.com mail
/etc/network/interfaces:
The primary network interface
auto eth0
iface eth0 inet static
address ip1
netmask 20
gateway ******
dns-search invalid
dns-nameservers *******
up ip route replace ***** via ****** dev eth0
second IP
auto eth0
iface eth0 inet static
address ip2
netmask 20
gateway ******
dns-search invalid
dns-nameservers ******
I also access mailcow through my link mail.domain.com, and everything is running fine. However, I don’t have an SSL certificate. In the ACME log, I found the following error:
mail.domain.com - Cannot match your ip1 against hostname mail.domain.com (DNS returned ip2)
mail.domain.com - Found A record for mail.domain.com: ip2
mail.domain.com - OK: ip1, 0000:0000:0000:0000:0000:0000:0000:0000
mail.domain.com - Detecting IP addresses…
It seems that Mailcow keeps using/favoring ip1, even though Mailcow is running on ip2, which is causing the error. Does anyone have an idea how to resolve this?