Domain Names, Nameservers, DNS entries, Argh!

Getting your ideal domain name purchase and pointed at your hosting provider is a tricky process. The good news is, you only have to get it right once!
We’re going to take a few extra steps for future maintainability, readiness for CDN, caching & SSL.

Things you’ll need before working through this article:

Purchase your domain name

You can pick up a domain name anywhere. We use namecheap, but there’s also GoDaddy, CrazyDomains, and a hundred more.
The price rarely differs by more than $2-3 per year, and the service offerings are very similar.
A .com domain that’s any good is very hard to come by, so prepare to be disappointed or get creative.

If there’s an option to enable domain privacy, do it! I made the mistake once of buying a domain and switching it off, and I still receive emails offering cheap off-shore hosting, web design, logo design, and welcome mats.

Greetings of the day indeed!
Greetings of the day indeed!

 

Set up your DNS Hosting

Your DNS host tells the browser where to find the server it’s looking for. It says “mail.mydomain.com” is served by gmail, “support.mydomain.com” is served by ZenDesk, and “www.mydomain.com” is served by wpengine. It can point a web address to another web address, to an IP address, and a few other useful things.

In the old days, we used our domain name registrar (e.g. Namecheap, above) for our DNS Hosting too. They usually charge for it, and offer half-baked functionality.

We use CloudFlare for this now. Out of the box, CloudFlare comes with security monitoring, SSL, aggressive caching, DDOS protection, and automatic CDN.

Create an account with CloudFlare and add the domain you purchased above. CloudFlare will scan the domain and add it so you’re nearly ready to go.

You need to point your domain name (held at the domain registrar above) to CloudFlare now, so CloudFlare can route your customers where they need to go. This is ‘changing the nameservers’.

Change the nameservers

So, CloudFlare knows all about our domain. Our domain registrar doesn’t know we’re using CloudFlare yet, so we have to tell them! The instructions below assume you’ve purchased your domain through namecheap, but other registrars will be similar.

Sign in, and visit your domain list. Click “Manage” on the right, under “Nameservers” choose “Custom DNS”. Enter the name servers as below to route all traffic to CloudFlare.

Sign in, and visit "Domain List"

Set the name servers to Isla and Josh.

 

Great. Sign out of Namecheap and back to CloudFlare.

Send the traffic where it needs to go

Warning! Up to this point, your domain will still be working fine. The instructions below to delete DNS entries could make your existing site stop working.

Back in CloudFlare, we’ve got some configuration to do now. Different addresses need to be handled by different servers, and this is where we need to configure it all.

In CloudFlare, visit the “DNS” tab.

The website.

If there’s an existing ‘www’ entry in the table, delete it. If there’s an A record, delete it.

Create a new CNAME record to catch requests to “[mysite].com” and send them to WPEngine. Click “Add Record”.

Create the root CNAME record.

Create another CNAME record to catch requests to “www.[mysite].com” and send them to WPEngine. Click “Add Record”.

Create the WWW CNAME record.

Great. Requests for your site are going to WPEngine now (We need to tell WPEngine to expect them though! We’ll do that in a minute)

Emails.

OK, you’ve got an account set up with google apps, right? OK if not, follow this first!

We need to tell CloudFlare that your emails are handled by google. You need to add 5 separate servers for this, so it’ll take a few minutes.

For each of the 5 servers and priorities in the table below, carry out the steps.

MX server address Priority
ASPMX.L.GOOGLE.COM 1
ALT1.ASPMX.L.GOOGLE.COM 5
ALT2.ASPMX.L.GOOGLE.COM 5
ALT3.ASPMX.L.GOOGLE.COM 10
ALT4.ASPMX.L.GOOGLE.COM 10

Create a new DNS entry,

mx-record-1

Select “MX” for type of record, and enter your domain name in the second box. Click the third to configure further.

further-config-emails

Click “Add Record” to save your entry. Remember, you need to do this for each of the 5 servers above.

Great, email is set up.

 

Leave a Reply

Your email address will not be published. Required fields are marked *