Heroku + Zerigo DNS + Google Apps Email
At Witsvale, we are using Heroku to quickly deploy and iterate. Previously, we were contented with just witsvale.heroku.com. But while preparing to go live, we had to migrate www.witsvale.com, along with our Gmail email.
While the entire process wasn't very difficult, there were a couple of pitfalls which made it take longer than expected.
Here's what I wanted to accomplish:
Move the domain from domain.heroku.com to www.domain.com
Use Gmail as our email provider
Have mail.domain.com point to Gmail
Follow the instructions over here to add the custom domain add on and the Zerigo addon. Be sure to add BOTH www.domain.com and domain.com.
Zerigo will automatically add the CNAME / A Records, so no additional configuration is needed.
However, this is only one half of the equation. You will still need to point your domain to Zerigo's nameservers.
Depending on your registrar (we use Singhost), you can update your domain to point to Zeringo's nameservers. This is normally done via CPanel, or a similar dashboard interface. Alternatively, you may ask your service provider to do this for you, and add these to the nameservers (and removing all existing ones which point to the old server, if any)
Now, you'll probably have to wait from a few minutes (if you are extremely lucky) or up to 24 hours, for the DNS to propagate. In my experience, it took around 5 hours, but it really depends on your ISP.
An easy way to check is to type this in your terminal window (without the www):
Inspecting the results, you'll see something like:
www.domain.com is an alias for proxy.heroku.com.
proxy.heroku.com has address 50.16.332.131
proxy.heroku.com has address 50.16.213.101
proxy.heroku.com has address 184.73.172.40
Obviously the results will not be the same, but you get the idea.
Once that command yields the above result, the DNS entries would have been properly propagated.
Tiny Caveat: It will take up to a day for propagation to occur, and if you had a previous IP address to which your domain is pointed to, it might revert back to the old IP address. Again, give it some time and it should resolve itself.
Using Gmail as the email provider
This assumes that you have already set up your domain with Google Apps.
This is pretty easy using Zerigo's control panel. Simply log in into your Heroku account, select the application you want to manage, and then select "Zerigo DNS" from the Addons drop down.
Once you are in, make use of the nifty "Add Snippet" feature and select Google Apps Email" - And you're done!
Once again, to check, use:
and you see something like:
domain.com mail is handled by 1 aspmx.l.google.com.
domain.com mail is handled by 10 alt1.aspmx.l.google.com.
domain.com mail is handled by 20 alt2.aspmx.l.google.com.
Once you see the above result, you would be able to access email via
http://mail.google.com/a/domain.com
Getting to mail.domain.com
Now here was the thing which tripped me up. I wrongly assumed that setting the above up would have mail.domain.com set up too. Looking through various tutorials did not point me to the correct direction, until I contacted Zerigo's awesome tech support :)
Anyway, it's pretty simple.
Just log in into the Zerigo control panel, add the following CNAME entry:
Wait a little while, and you'll be able to access your mail from mail.domain.com. Hope this saves someone hours of unneeded work and grief.