We often need to change the IP address of the Zimbra server. In this guide, we will show you the precise way to change the IP address of your Zimbra server.
Let’s imagine, in your Multiverse Of Madness you are dealing with multiple issues as mentioned below:
In Earth-616, you are going to change your existing service provider. Therefore, the existing IP addresses of your network infrastructure need to be changed including your Zimbra server.
In Earth-1610, you have suffered severe spamming incidents from your server. For that, your server IP address’s reputation is damaged beyond repair. Also, the IP address is listed in several known/unknown BL databases (black listing) and you are unable to delist them by yourself. Your email communication with the remote end is critically hampered. In this situation, you want to change the IP address of your Zimbra server.
In Earth-10005, you are migrating your server from one hardware to another hardware. After the migration, you need to change the IP address of your new server as per the old IP information.
There can be some other exceptional situations when you may need to change the IP address of your Zimbra server.
Follow this article and change the IP address in a convenient way.
Change the IP Address Of Your Server
Before modifying Zimbra, change the IP address of your server.
root@mail:~# vi /etc/netplan/00-installer-config.yaml # This is the network config written by 'subiquity' network: ethernets: ens33: addresses: - 192.168.1.210/24 gateway4: 192.168.1.1 nameservers: addresses: - 184.108.40.206 search:  version: 2 [Save and Exit] root@mail:~# sudo netplan apply
Change The Hosts Configuration
/etc/hosts file configuration with the new IP information.
root@mail:~# vi /etc/hosts 127.0.0.1 localhost 127.0.1.1 mail 192.168.1.210 mail.example.com mail # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback localhost fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters [Save and Exit]
Modify Zimbra MTA Mynetworks
Check your existing Zimbra MTA mynetworks setup.
zimbra@mail:/root$ postconf mynetworks mynetworks = 127.0.0.0/8 [::1]/128 192.168.2.0/24
Here we can see the old IP was from 192.168.2.0/24 IP network. Change the old IP with the new IP.
Recommendation:Make sure that the localhost “127.0.0.0/8” network is included. Never allow a full network address/IP block in your mynetworks settings. Only allow the specific IP address of your server or any other server.
Change the Zimbra MTA mynetworks
zimbra@mail:/root$ zmprov ms mail.example.com zimbraMtaMyNetworks '127.0.0.0/8 [::1]/128 192.168.1.210/32' zimbra@mail:/root$ postfix reload /postfix-script: refreshing the Postfix mail system zimbra@mail:/root$ [Only change your old IP and keep other information as it is]
Check if Zimbra LDAP needs any modification:
zimbra@mail:/root$ zmprov gs mail.example.com zimbraMtaMyNetworks # name mail.example.com zimbraMtaMyNetworks: 127.0.0.0/8 [::1]/128 192.168.1.210/32
It is all set
All is set now. Restart your Zimbra services and check the settings you modified earlier.
zimbra@mail:/root$ zmcontrol restart Host mail.example.com Stopping zmconfigd...Done. Stopping zimlet webapp...Done. Stopping zimbraAdmin webapp...Done. Stopping zimbra webapp...Done. Stopping service webapp...Done. Stopping stats...Done. Stopping mta...Done. Stopping spell...Done. Stopping snmp...Done. Stopping cbpolicyd...Done. Stopping archiving...Done. Stopping opendkim...Done. Stopping amavis...Done. Stopping antivirus...Done. Stopping antispam...Done. Stopping proxy...Done. Stopping memcached...Done. Stopping mailbox...Done. Stopping logger...Done. Stopping dnscache...Done. Stopping ldap...Done. Host mail.example.com Starting ldap...Done. Starting zmconfigd...Done. Starting dnscache...Done. Starting logger...Done. Starting mailbox...Done. Starting memcached...Done. Starting proxy...Done. Starting amavis...Done. Starting antispam...Done. Starting antivirus...Done. Starting opendkim...Done. Starting snmp...Done. Starting spell...Done. Starting mta...Done. Starting stats...Done. Starting service webapp...Done. Starting zimbra webapp...Done. Starting zimbraAdmin webapp...Done. Starting zimlet webapp...Done. zimbra@mail:/root$
Your email service should be okay now.
Remember to change your old IP address from all relevant DNS records and relay hosts or else you may face a mail send/receive problem in spite of a fully functional Zimbra server.
That’s it for today.