There are a few reasons why someone would need to change the IP address of server. It might be that your server is under attack, you are migrating from your existing provider or the current IP address got blacklisted, you will need to follow certain steps to change the IP on your server.
Whilst changing the IP address on a linux server is straight forward, when it comes to a Zimbra server there are a few more steps to be done. In this article we will show the steps and commands you need to perform on your server so that Zimbra can continue working with the new IP address.
Pre-requisities
- Root access or sudo-privileges access on server
- Ability to switch as the ‘zimbra’ user
Steps to Change IP address on Zimbra Server
Assuming you have already changed the IP address on your server via NetworkManager or the configuration file directly, let’s take a look at the next steps to change your Zimbra server’s IP address.
1. Change the Hosts File
Using your favorite editor, edit the file /etc/hosts and replace your old IP with the new one as follows:
root@mail:~# vi /etc/hosts
Sample output of /etc/hosts files:
127.0.0.1 localhost
45.142.201.1 mail.example.com mail
2. Modify Zimbra MTA Mynetworks
First check your current IP addresses included in the MyNetworks MTA using the following commands:
Switch to zimbra user:
root@mail:~$ su zimbra
Then run the following command:
zimbra@mail:~$ postconf mynetworks
Sample Output:
mynetworks = 127.0.0.0/8 [::1]/128 45.142.201.251/32
You can see the current/old IP address which is “45.142.201.251”. Change it to the newly assigned IP address of your server (e.g. 45.142.201.1) using the following command:
zimbra@mail:~$ zmprov ms mail.example.com zimbraMtaMyNetworks '127.0.0.0/8 [::1]/128 45.142.201.1/32'
Then reload postfix for the new configuration to be applied.
zimbra@mail:~$ postfix reload
You are all set! The last step remaining is to restart Zimbra services using the following command:
zimbra@mail:~$ zmcontrol restart
Sample Output:
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:~$
Get Secure and Private E-mail Service powered by Zimbra
At NetShop ISP you can order a Zimbra-based email hosting service which allows you to use a domain name of your choice, create mailboxes and use it on any device.
Browse Email hosting plans: https://netshop-isp.com.cy/addons/zimbra-email-hosting/
Alternatively, you may opt for your own, dedicated Zimbra installation using a VPS or Dedicated Server.