29 Jan 2012

ZPanel on AWS EC2 - 2 : Route 53 DNS for eMail and Web

In Part 1 of this series we looked at installing ZPanel to an AWS EC2, a quick and easy process, however to 'go-live' with your new installation you'll need to let the internet know where your domain and website are, and where to send your eMails to (and from). You could manage your DNS through your domain registrar using their own namservers + related records config, or, you could use Amazons superb Route 53. I really like Route 53 and in this post I'll show you how to configure it, with tailored settings go get you up and running in quite literally, 1 minute.

You don't actually need to manage your DNS 'off-site' (so to speak), and other panels such as ISPConfig 3 or OpenPanel offer easy setup for inclusive hosting + DNS on the same box, however this is not recommended. Having everything on one box is an obvious single point of failure as you have one NS record IP. It's best practice to have at least x2 nameservers for redundancy, Route 53 provides x4.

Ok, down to business, you've set up your domain in ZPanel and configured some eMail mailboxes, the next step is to configure Route 53 (accessed from the AWS Management Console). 

Firstly, create a Hosted Zone to correspond to your domain, once done create a base selection of 'Record Sets' as below (I'm using ec2services.net as an example domain).


Note the TTL (Time to live), in this example I've set things to 60 seconds, this will ensure we're ready to roll when I update the NS (Nameserver) records. The IP address corresponds to the EIP (Elastic IP) of your ZPanel EC2 instance (And no, that's not a genuine IP, obviously). 

The next, and last stage is to update the NS records at your registrar, this is a simple step and the method for doing so is about the same for all hosting companies, I use 123Reg and the procedure is super easy. The advised update window is usually 48 hours, although with 123Reg I've had things dropping in inside an hour (which is why I use them). Simply remove the existing registrars NS records and replace them with the x4 AWS NS entries as listed in the Route 53 Record Set for your newly created Zone.

To check update progress I use http://www.zoneedit.com/lookup.html, once things are resolving to the AWS NS for your Domain you should be good to go.

One small 'gotcha' I had (and thanks to the superb ZPanel support team for resolving this for me) was to do with eMail. One domain I'd created was using Google Apps for eMail, with corresponding MX entries listed as Route 53 Record Sets, however a PHP contact form on the hosted site relayed nothing, nor were other domains on the same box able to send to any address for the domain in question, all I was getting was a 'Virtual Hosts 550' error. The problem? I'd pre-created a mailbox on the server which although I'd deleted, the 'domain' itself was still present in the PostFix database, thus fooling the server into thinking it managed mail for a domain it actually didn't. I deleted the problem domain from inside the Postfix MySQL DB using phpmyadmin and mail started flowing freely and happily. Easy when you know how :-)

For info AWS Route 53 is charged at $0.50 per Zone per month, which is about £3.80 for the full year in UK currency. If that's not value for money I don't know what is.


2 comments:

Aldus Logan said...

Thanks for sharing this information with all. just keep update the blog with useful information.


online business software

Eduardo said...

Thanks again for the second part of the configuration of zpanel.
Have in mind to do some video on this whole process?

Post a Comment