Configure TinyDNS (djbdns) To Use Google Apps Email Service
Google has an amazing service that allows domain owners to basically use GMail’s capabilities with a custom domain. For example, instead of having someuser@gmail.com, you can have someuser@yourdomain.com, while still reaping the benefits of GMail. Why do this? For a number of reasons:
- Less stress on your server
- Google requires TLS (SSL) for incoming and outgoing communications
- Full IMAP/SMTP support
- GMail’s web interface for your domain
- Google is stable and provides excellent uptime
- Speed definitely isn’t an issue
- Easier than maintaining your own incoming/outgoing mail servers. Let Google do the work!
Ok, so here’s how to take advantage of all these benefits using TinyDNS (djbdns). First, if you haven’t already, setup your Google Apps account by visiting: http://www.google.com/a/cpanel/domain/new. Once that’s out of the away, verify domain ownership by adding some unique identifier to your CNAME records, or uploading a special HTML file (both methods are available inside the google apps admin interface). Once verified, ssh to your server and open /etc/tinydns/root/data with your favorite text editor. The path on your server might be different, so use some common sense.
/etc/tinydns/root# vi data
Now add the following:
# MX record (mail) #yourdomain.com:255.255.255.1:a::60 @yourdomain.com::aspmx.l.google.com.:1:1800 @yourdomain.com::alt1.aspmx.l.google.com.:5:1800 @yourdomain.com::alt2.aspmx.l.google.com.:5:1800 @yourdomain.com::aspmx2.googlemail.com.:10:1800 @yourdomain.com::aspmx3.googlemail.com.:10:1800 @yourdomain.com::aspmx4.googlemail.com.:10:1800 @yourdomain.com::aspmx5.googlemail.com.:10:1800 ‘yourdomain.com:v=spf1 a mx include\072google.com, include\072googlemail.com ~all:3600 #aditional CgoogleSOMEUNIQUEVERIFYCODE.yourdomain.com:google.com Cmail.yourdomain.com:ghs.google.com
Make sure to change 255.255.255.1 to your server’s IP and yourdomain.com to the domain you registered with Google when creating your Google Apps account. Save the changes and exit. Still in /etc/tinydns/root, rebuild dns entries by typing make.
/etc/tinydns/root# make
Assuming everything went as planned, and I didn’t omit any pertinent steps, http://mail.yourdomain.com/ should load a GMail type interface within a few minutes. If I did forget anything, please comment or ask questions below.



[…] domain owners to use GMail for domain names other than GMail. If you have the ability to edit your DNS’s MX records, the process is pretty painless. The end result is a GMail like interface (pop3, smtp, and imap all […]