When you change the IP address on a Virtualmin server, the server will detect the IP address has changed and prompt to update all the vhosts. However, when you then examine the Virtual hosts you’ll see that the old IP address lingers as a NAT IP address even though you don’t use NAT.
Use this script to fix it across all virtual servers:
virtualmin list-domains --name-only | while read domain; do virtualmin modify-domain --domain "$domain" --no-dns-ip; done
This will ensure that the server only uses the shared IP address you have defined.
From the manual:
If your system is on an internal network and made available to the Internet via a router doing NAT, the IP address of a domain in DNS may be different from it’s IP on the actual system. To set this, the
--dns-ip
flag can be given, followed by the external IP address to use. To revert to using the real IP in DNS, use--no-dns-ip
instead. In both cases, the actual DNS records managed by Virtualmin will be updated.
https://www.virtualmin.com/docs/development/api-programs/modify-dns/#change-dns-settings-for-virtual-servers