How to add fully qualified hostname for zimbra mail server

To add a fully qualified hostname (FQHN) for a Zimbra mail server, you can follow these steps:

Method 1: Using the Zimbra Web Interface

  1. Log in to the Zimbra Web Interface as the administrator.
  2. Click on the "Configure" button in the top-right corner of the screen.
  3. Select "Domain" from the drop-down menu.
  4. Click on the "Edit" button next to the domain name.
  5. In the "Domain" page, scroll down to the "General" tab.
  6. In the "Fully Qualified Hostname" field, enter the FQHN you want to use (e.g., mail.example.com).
  7. Click "Save" to save the changes.

Method 2: Using the Zimbra Command-Line Interface

  1. Log in to the Zimbra server as the root user.
  2. Run the following command to edit the domain configuration:
    zmprov md <domain_name> modifyFullyQualifiedHostname <FQHN>

    Replace <domain_name> with the name of your domain and <FQHN> with the fully qualified hostname you want to use (e.g., mail.example.com).

For example:

zmprov md example.com modifyFullyQualifiedHostname mail.example.com
  1. Press Enter to save the changes.

Method 3: Editing the Zimbra Configuration File

  1. Log in to the Zimbra server as the root user.
  2. Open the localconfig.xml file in a text editor:
    sudo nano /opt/zimbra/config/localconfig.xml
  3. Search for the <fully_qualified_hostname> element and update its value to the FQHN you want to use (e.g., mail.example.com).
  4. Save the changes to the file.
  5. Restart the Zimbra services to apply the changes:
    sudo /opt/zimbra/bin/zmcontrol restart

After updating the FQHN, you may need to update the DNS records for your domain to point to the new hostname. Additionally, you may need to update any external services or applications that rely on the old hostname to use the new FQHN.