After spending a week attempting to install a fresh Ubuntu 22.04 LTS and MIAB v.60.1 with no luck, I finally managed to crack the case. First - this may or may not apply to you, as a2hosting VPS may be the culprit.
If your installation fails with errors indicating that domain names cannot be found, here is how I went managed to install successfully:
1.) Change your hostname to include a subdomain of ‘box.’ For example: box.example.com
2.) Install your VPS with the latest Ubuntu (on a2hosting, it is currently version 20.4 LTS.)
3.) Install the editor of your choice, then update and upgrade. I use nano:
apt install nano
apt update
apt upgrade
4.) edit the etc/fstab file to make /tmp executable:
nano /etc/fstab
---------------original----------------
/tmp /var/tmp none rw,noexec,nosuid,nodev,bind 0 0
tmpfs /tmp tmpfs size=1G,nodev,nosuid,noexec 0 0
---------------altered----------------
/tmp /var/tmp none rw,exec,nosuid,nodev,bind 0 0
tmpfs /tmp tmpfs size=1G,nodev,nosuid,exec 0 0
5.) reboot, then mount /tmp as executable:
reboot
mount -o remount,exec /tmp
mount -o remount /tmp
6.) Install the distro installer and run:
apt install ubuntu-release-upgrader-core
do-release-upgrade -d
7.) After the system reboots, remount /tmp as executable:
mount -o remount,exec /tmp
mount -o remount /tmp
8.) Install curl and begin the Mail-in-a-Box installation:
apt install curl
curl -s https://mailinabox.email/setup.sh | sudo -E bash
[optional - install the forked version:# curl -L https://power-mailinabox.net/setup.sh | sudo bash]
-------------installation will fail with name resolution failures--------------------
9.) Edit mailinabox/setup/system.sh
nano mailinabox/setup/system.sh
---------------original---------------
restart_service bind9
systemctl restart systemd-resolved
---------------altered----------------
restart_service bind9
systemctl stop systemd-resolved
service named restart
10.) edit /etc/bind/named.conf.options
nano /etc/bind/named.conf.options
--------------original----------------
// forwarders {
// 0.0.0.0;
// };
--------------altered----------------
forwarders {
9.9.9.9;
};
--------------original----------------
dnssec-validation auto;
--------------altered----------------
dnssec-validation no;
11.) Restart the DNS services:
service bind9 reload
service bind9 restart
systemctl stop systemd-resolved
service named restart
service nsd restart
12.) Check that domain name resolving is working
ping google.com
13.) Restart the installation process for MIAB
curl -s https://mailinabox.email/setup.sh | sudo -E bash
[optional - install the forked version:# curl -L https://power-mailinabox.net/setup.sh | sudo bash]
Everything should work now. When the system reboots, you may or may not have to restart the DNS services outlined in step 11:
service bind9 reload
service bind9 restart
systemctl stop systemd-resolved
service named restart
service nsd restart
If this is the case, these commands can be placed in a script file and triggered to run after every reboot.