Setting up your own email server will help you control the traffic, manage the service, and protect your privacy by storing all your emails on the email server. But before you going to set up an email server on Ubuntu 18.04, you need to configure the DNS server. So, just follow the below instructions to setup email server Ubuntu 18.04.
Configure Dns Server On Ubuntu 18.04
Step :1 First, log in to your account using SSH (secure protocol).
Step :2 Now, open the Terminal window and update the APT package repository cache using the below command.
Step :3 To configure the DNS server, you need to install an additional tool called, Bind9. Follow the below command to install it.
sudo apt install bind9
Step :4Next, press the Y and Enter keys on your keyboard to proceed.
Step :5The Bind9 tool will now be installed.
Step :6Follow the below command to create a new file zone.
sudo nano /var/cache/bind/db.test
Step :7Now, add the following command lines and replace “192.168.250.7” with your computer's IP address and replace test.com with your domain name.
$ORIGIN test.com.$TTL 1D@ IN SOA ns1 root(1 ;serial1D ;refresh2H ;retry2W ;expire5H ;minimum);@ IN NS ns1ns1 IN A 192.168.250.7mail IN A 192.168.250.7@ IN MX 5 mail
Step :8Press the CTRL + O keys to save the changes and hit the CTRL + X keys to exit the nano editor.
Step :9Now, check the configuration file by following the below command.