To differentiate between virtual machines we need to set the fully qualified domain names for each. Learn how to do this using the hostnamectl command and then snapshot them.
- [Instructor] Now that we have our virtual machines created, their networks configured, and our local name resolution set up, let's set the host names under VM's. We'll be naming them rhhost1.localnet.com, rhhost2.localnet.com, and lastly, rhhost3.localnet.com. Make sure all three VM's are booted up and log into rhhost1 first. In a terminal type in, sudo hostingnamectl set-hostname rhhost 1.localnet.com, And hit enter.
Type in your password if prompted. Now verify the results by typing in, sudo hostnamectl status, and hit enter. The hostname has been set but our prompt won't change until we log out and back in again. Also closing the terminal and reopening it will force it to change the prompt as we can see here. Now login to rhhost2 and run the same command again. This time changing the hostname to rhhost2.localnet.com.
Type in sudo hostnamectl set-hostname rhhost2.localnet.com, and hit enter. Type in your password if prompted. And once again verify with sudo hostnamectl status. If all is good then move on to rhhost3. Login to rhhost3 and run the same command again. Once again changing the hostname to rhhost3.localnet.com.
Enter your password if prompted, and then verify with sudo hostnamectl status, and hit enter. Now our prompts will reflect which host we're logged in to making it easier to keep it all straight. I will also include video overlays to let you know when I switch machines. It's worth noting that Postfix uses the value from the OS gethostname function for various configuration items, which returns the host thing we just set. We can override this in the configuration but it's best to have your hostname configured properly anyway.
If you want to preserve these changes, you might want to consider taking another snapshot of HVM and calling it Hostname configured.
- Overview of email and mail agents
- Installing Postfix
- Postfix services and commands
- Postfix configuration files
- Configuring a mail service
- Creating a mail gateway