i was just getting lot of queries regarding setup of GApps with external web host. So basically using GApps for email hosting and using a separate web host for Web hosting.
Now we can have this kind of setup in two ways:
- using DNS hosting of web host
- using external DNS hosts
- web host doesn’t allow using custom mx
- you want to create cname records and web host is not giving option to do so
- you can put only one mx record but still you want all emails on time with full redundancy
- you also want to create advanced records like SPF, SRV etc
So here’s the info on #2
here i am giving some DNS related steps and tricks to do that.
Step 1 – choose DNS Host
Now here you may choose your registrar’s dns hosting (if available) or else you can go with an external free dns host (remember free DNS hosts are highly reliable)
you may go with:
Incase you need something with gurantee, you can try out Googleing for “paid external dns”
Step 2- create GApps records
Now here start creating GApps records….as
- mx records – http://www.google.com/support/a/bin/answer.py?hl=en&answer=33352
- cname record for verification and custom url’s – http://www.google.com/support/a/bin/answer.py?hl=en&answer=47283
- Optional – SRV records – These are to enable usage of GTalk for GAPps account from outside of Google network. Here’s more info. – http://anuragbhatia.com/2008/09/googles-srv-records/
- Optional – SRF records – These are to protect your domain from being used by spammers.
in case you want to use ONLY GApps for sending mail on behalf of your domain, just create this “txt record” at dns hosting for root (domain.com) zone –
v=spf1 include:aspmx.googlemail.com ~all
and incase you plan to use servers others then (but including) Google’s then use this wizard to generate custom SPF for your domain.
Step 3 – Configuring Web Hosting
to configure web hosting, you need to point root zone (i.e domain.com) and also subzones to web hosting server’s ip using “A record”
Now here exists two possibilities:
- your web host gave you web hosting server’s ip (sweet host!) 🙂
- your web host gave you only nameservers and not any hosting server’s ip.
in 1st case ignore next section and scroll down and further instructions.
here’s what to do in 2nd case to get ip of hosting server.
Here’s the idea is just to query nameservers given by web host for “A records” of your domain.
- use any dns lookup tool, for simplicity i am using zoneedit’s nslookup tool
- put your own domain in domain field
- select record as “A record” for querying
- use nameservers to query of your web host.
here’s a preview
(click on image to enlarge)
you can also use dig command if you are on Linux, use it as
dig email@example.com a
Thus you will notice output as
[anurag@root ~]$ dig firstname.lastname@example.org a
; <<>> DiG 9.2.4 <<>> email@example.com a
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 398
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;firstname.lastname@example.org. IN A
;; ANSWER SECTION:
email@example.com. 60 IN A 184.108.40.206
;; Query time: 253 msec
;; SERVER: 220.127.116.11#53(18.104.22.168)
;; WHEN: Mon Sep 29 16:23:41 2008
;; MSG SIZE rcvd: 65
Now after getting ip of web hosting server just create the following records:
- A record for domain.com pointing to that ip
- A record for *.domain.com pointing to that ip
This will enable web hosting on domain.com as well as all subdomains (including www.domain.com)
Step 4 – Changing nameservers of domain
Now just change the nameservers of your domain. Point your domain to nameservers of the dns host you are using.