How to Setup Amazon EC2 instance (Ubuntu 14.04), Route 53 and Mail in a Box

Hello,

I would like to know the complete steps for getting Mail in a Box running. In particular, how to set up the Nameservers.

I have seen the video for Mail in a Box. It shows a Namecheap example.

I have one domain; e.g., domain.com. This domain handles my website and my emails. I have two servers - one for my website and one for email. The email server has 1GiB. Perhaps I should just purchase a separate domain for email?

Per Amazon:
Adding or Changing Name Servers and Adding or Changing Glue Records

“If you add a name server or change the name of a name server and specify a name that is a subdomain of the domain that you’re updating (for example, ns1.example.com in the domain example.com), Amazon Route 53 prompts you to specify one or more IP addresses for the name server. These IP addresses are known as glue records.”

When I added box.domain.com, I was not prompted for an IP address. Can I have a Nameserver record for domain.com and another one for box.domain.com?

Per Digital Ocean:
https://www.digitalocean.com/community/tutorials/how-to-run-your-own-mail-server-with-mail-in-a-box-on-ubuntu-14-04

“If you do have an active website at your domain, make sure to set up the appropriate additional DNS records on your Mail-in-a-Box server. Otherwise, your domain won’t resolve to your website. You can copy your existing DNS records to make sure everything works the same.”

I am not sure what this message from Digital Ocean means from a practical standpoint; i.e., in terms of the steps I need to take. I have an active website at my domain.

Also, Amazon say to add the following: (for example, ns1.example.com in the domain example.com),
Digital Ocean says ns1.box.example.com yourserverip and then example.com NS ns1.box.example.com
Thanks,

It seems the steps are as follows (not for .fi domains):

hostname
sudo echo “box.example.com” > /etc/hostname

sudo nano /etc/hosts
==>127.0.0.1 localhost.localdomain localhost
==>your_server_ip box.example.com box
save and close the file

Sign in to the AWS Management Console and open the Amazon Route 53 console at https://console.aws.amazon.com/route53/.

In the navigation pane, choose Registered Domains.

Choose the name of the domain for which you want to edit settings.

Choose Add/Edit Name Servers.

In the Edit Name Servers dialog box, do the following:

update the fields with ns1.box.example.com, ns2.box.example.com, ns3.box.example.com, and ns4.box.example.com to map:
example.com to NS to ns1.box.example.com
example.com to NS to ns2.box.example.com

update each of the four glue boxes with yourserverip to map:
ns1.box.example.com to yourserverip
ns2.box.example.com to yourserverip

see your EC2 instance for your server’s ip. Hint: use an elastic IP.

Wait for Amazon to update the nameservers before you install Mail in a Box. You can confirm the nameservers were updated by using dig, if on Linux.
==>dig example.com MX
==>dig example.com A
==> dig example.com +short

Go to your EC2 instance. Select the security group for your instance. Choose the Inbound tab. Choose edit.
Open ports 22 (SSH), 25 (SMTP), 53 (DNS; must be open for both tcp & udp), 80 (HTTP), 443 (HTTPS), 587 (SMTP submission), 993 (IMAP), 995 (POP) and 4190 (Sieve).

Install Mail in a Box:
==>curl -s https://mailinabox.email/setup.sh | sudo bash