Change FQDN

From Proxmox Mail Gateway
Jump to navigation Jump to search

Introduction

Changing the fully qualified domain name (FQDN) or IP address of a Proxmox Mail Gateway installation is basically done like on any other GNU/Linux system. However, there are a few config files on which Proxmox Mail Gateway relies to get its configuration right.

In most situations, you will need to make changes to your domain records to reflect the change of hostname and/or IP address since email delivery relies on correct DNS records.

This short article will walk you through all the necessary places in which you might need to adapt the configuration.

For the remainder we assume that:

  • we want to change the FQDN of our installation to pmgchanged.proxmox.com
  • we want to change the IP address and network to 192.0.2.72/24
  • the Gateway in our network is 192.0.2.1
  • the DNS server in our network is 192.0.2.53

Adapting the FQDN on the Proxmox Mail Gateway

This needs to happen in 3 places:

  • /etc/hostname - the short hostname (pmgchanged, the part before the first .,) needs to be entered there.
  • /etc/hosts - there needs to be an entry with the main IP pointing to the short hostname and FQDN:
127.0.0.1 localhost.localdomain localhost
192.0.2.72 pmgchanged.proxmox.com pmgchanged
# leave remaining /etc/hosts untouched
 
  • /etc/resolv.conf - needs to contain the domain name part as search - This can also be accomplished in the GUI (on the main Configuration Menu entry):
search proxmox.com
nameserver 192.0.2.53
 

Changing the IP configuration

Adapt the /etc/network/interfaces file with the new IP

# comments
auto lo
iface lo inet loopback

auto ens18
iface ens18 inet static
        address 192.0.2.72/20
        gateway 192.0.2.1
 

Consideration for clustered setups

If you run a Proxmox Mail Gateway cluster, you will need to adapt /etc/pmg/cluster.conf with the changed IP addresses and hostnames and make sure that passwordless SSH authentication is still working between the nodes in the cluster.

Additionally check all other nodes' /etc/hosts files to make sure that the old IP address and FQDN are replaced there as well.

Updating the IP and or FQDN on all relevant internal systems

Change the internal systems which use the Proxmox Mail Gateway to the new IP or FQDN. This can be the mailserver which relays mails via the Proxmox Mail Gateway.

Changing all relevant DNS records

Email relies on DNS records for its operation.

  • If you change the FQDN of your Proxmox Mail Gateway installation, make sure to update the MX records of all domains for which it relays email to the new FQDN.
  • Add or Update the A record of the FQDN to point to the current IP address of your Proxmox Mail Gateway
  • Update the reverse Pointer (PTR record) of the IP address to point to the new FQDN of your Proxmox Mail Gateway