Custom Nameservers with WordPress.com
A week ago I moved my blog to WordPress.com, the hosted service by Automattic. Many would say that I “downgraded” from a fully-fledged hosting service like MediaTemple’s GridService. The truth is I stopped searching for “the best hoster” and I focused more on what I needed and what I can or should spend. I write mostly in Romanian, so I won’t get a Digg or Slashdot effect, I have a blog, a Flickr photo gallery and, most importantly, a mail address. I went to WordPress.com because I felt the service was really good with low response times.
When I bought the Domain Mapping upgrade I was glad that my blog was finally on WP.com, but I was a bit worried that I had to set the nameservers to match those of WordPress.com. They do offer some sort of integration with Google Apps For Your Domain, but that’s it. Truth be told, Automattic does not offer hosting services or DNS hosting so the lack of features is understandable, but I wanted a bit more control so, after a couple of hours worth of research, I changed the nameservers again. Here’s how I did it, plus some hints and tips.
A note of caution before I start: I am used to system administration. I have set-up a number of DNS servers on FreeBSD, Linux and Windows. I earn my living as a web developer so I have a better technical background than the Average Joe. If you feel that messing with the nameservers is too tricky for you, don’t try it. It may seem cool to be able to use mail.domain.com instead of mail.google.com/a/domain.com, but it’s way cooler to have a working DNS.
Also, this little guide is not supposed to trick the Domain Mapping feature. You still have to pay for it and everything in this guide won’t work if you don’t have that feature enabled (name-based virtual hosts, if you care to dig deeper).
That being said, let’s talk a bit about Domain Name Servers (or DNS or nameservers) and how they work with websites.
Servers around the world have an IP address. That’s what makes them unique. However, it’s easier to remember names instead of numbers so we have a system that translated domain names into IPs. For example, Jeffrey Zeldman’s IP is 64.207.133.90. If we type http://zeldman.com/ or http://64.207.133.90/ we’ll get his Daily Report, one of the best known blogs in the web design industry.
However, it would be foolish to have just one domain per IP so most web servers can do name-based virtual hosts. What does that mean? Well, you have only one IP for many domains and it’s the web server’s job to figure out which domain you want to access. A clear example is Shaun Inman’s blog, the Have A Mint site and Designologue which all rest on 72.10.44.23. If we just type the IP, the web server is smart enough to give back the default site, Shaun Inman’s blog.
On the other hand, there are some websites that are so busy that a single server can’t handle the traffic load. Google.com, for example, can be reached through a number of IPs that usually map to a full-blown server. WordPress.com also relies on a number of IPs. That means that all the servers know of the same domains or subdomains, but usually the fastest one responds. When you buy a Domain Mapping upgrade the web servers on WordPress.com know of your domain by adding a virtual host on all the servers.
So, how can we use custom nameservers with WordPress.com?
Well, why do we have to set the DNS to WP.com nameservers? The main reason is the web server IPs. If we had our own nameservers, we could add the information about the WP.com web servers so everybody would know that domain.com is actually at a certain IP. And that’s basically it.
On our own
But first, we must have our own nameservers. If your registrar doesn’t offer DNS managing capabilities, read on. Otherwise, you could skip the next couple of paragraphs.
There are companies that do only “DNS Hosting” meaning they host only the nameservers. Some are really expensive and offer a lot of features mostly for businesses, like UltraDNS and some are really cheap or even free. If you’re hosting your blog on WordPress.com, it’s likely that you’re going for the latter. If you can afford to pay a 15$ per year, go with DNSMadeEasy. They have a great service and they are really fast. Otherwise, you might want to check free hosts like EditDNS or EveryDNS.
I went with EveryDNS because it’s owner is David Ulevitch, founder of OpenDNS, a highly popular start-up based on DNS services. Also, EveryDNS has been up and running since June 2001, longer than most DNS services. However, you might also like EditDNS or another company.
Just create an account and then log in. We will add a couple records in a minute.
A, CNAME, MX
We agreed that a nameserver translates domains names to IPs so it’s easier for us to access a web site. Actually, that’s just a part of the tasks a DNS can do.
We can translate domains to IP using an A record. We can link one domain to another (or make a sort of alias) with a CNAME record. We can tell what server is supposed to get the mail using an MX record (no, not all mail is delivered to mail.domain.com).
Since we want to point the domain to our WordPress.com blog it might seem a reasonable choice to use a sort of alias, meaning a CNAME. Unfortunately, that works only for subdomains because a domain must have a real IP address, the WP.com’s IP addresses.
Here things get a bit trickier. If you use the WordPress.com IPs than you must be careful if and when they change the IPs. Usually, these things happen rarely, but they do happen. If you don’t see you blog, but other WP.com blogs work, it’s likely that you need to change the IPs. We’ll talk about that in a minute.
How do we get the IPs? First, you must have the Domain Mapping upgrade active, meaning that you paid for the upgrade and the nameservers are set to WP.com’s nameservers. Then, if you are on Linux or Mac OS X it’s simple. Open a console (or Terminal) and type:
dig your-domain-name.com A
We only care for the records that show the IP address (A records - that’s why we added an A at the end) and what’s in the ANSWER section, in the leftmost column. That’s the IP addresses we are looking for. Here’s a screenshot for my domain, andreimaxim.ro:
If you’re on Windows, dig is not installed by default so your best bet is nslookup. You’ll have to open a Command window and type:
nslookup -type=A your-domain-name.com
If you don’t want to mess with the command line, there’s a useful service by OpenDNS called CacheCheck. If you enter the domain name, it will return the A records in their cache. Here’s what it looks like for my domain:
Now that we have the IPs, usually six of them, we can enter them in the DNS control panel, either at EveryDNS, EditDNS or your registrar if it has DNS capabilities. The idea is to enter all of them as A records so we can still benefit from all WP.com servers, not just one of them.
If you had Gmail Apps For Your Domain enabled, you should also add the MX records. You should check Google’s help page Configuring Your MX Records or jump straight to the instructions for EveryDNS.
Before changing your nameservers to point to the DNS hoster of your choice, you should check if everything is alright. Running a
dig your-domain-name.com @ns1.everydns.netor
nslookup -type=A your-domain-name.com ns1.everydns.netThat’s right, we added the nameserver we want to query, in this case ns1.everydns.net. It should have the same results as the query before.
Right now you should be all setup to change your nameservers. In a couple of hours your changes should be active.
When things change
Usually, the IPs for such a platform are here to stay. However, if they do change, here’s what you have to do:
The first thing is you need to know the new IPs. We could use dig or nslookup to find the new records in the WordPress.com nameservers:
dig your-domain-name.com A @ns1.wordpress.com
or, if we are on Windows:
nslookup -type=A your-domain-name.com ns1.wordpress.com
From what you can see, we’ll query the first nameserver exactly the same way we did when we wanted to check if EveryDNS has our records correctly. Now we log in EveryDNS’s control panel (or your DNS hoster’s control panel) and edit the A records that changed.
Some companies can “lower the TTL”. That means that your records will be reloaded more often in the nameserver. Usually you’ll find that the TTL record is around 3600. That means your configuration will reload every hour (3600 seconds). You could lower it to 300 (that’s 5 minutes), but be careful to raise them back once everything looks OK.
Again, you should check the DNS hoster records like we did before, but be careful that most changes will take a while to be loaded in the nameservers. Usually, if you try after an hour or so to check the DNS records using dig your-domain.com A @ns1.everydns.net or the nslookup equivalent, you will be able to see the changes.
Lung post. Foarte faine poze.
Thanks for the great tutorial. You stated above under A, CNAME, MX that:
Here things get a bit trickier. If you use the WordPress.com IPs than you must be careful if and when they change the IPs. Usually, these things happen rarely, but they do happen. If you don’t see you blog, but other WP.com blogs work, it’s likely that you need to change the IPs. We’ll talk about that in a minute.
So if they change the IP’s what do I do because you forgot to mention it.
Thanks
Hi, Philip. You are right, I forgot to mention how to change the IPs. It’s really simple, you just have to query the WP.com nameserver, see what’s changed and then edit the DNS records so they match the new IPs.
I’d added some more detailed instructions at the end of the post. Hopefully you’ll find them helpful enough :)
Thanks Andrei,
Do you know if their is a way to run the nslookup (under your “When Things Change”) automatically every hour or so and to send an email to yourself if they have changed?
You could use a site monitor tool. There are a couple of free ones that send email alerts. Doing a quick search I saw that SiteUptime has a free plan and it should be good enough.
Thanks Andrei.
One of the most effective ways of driving traffic to a blog is often a banner exchange that shares the same genere. This is the source of a large number of repeat visitors when quality content is presented.
Foarte interesant postul Andrei. Merci.
Eu mi-am cumparat domeniu si vreau sa imi fac upgrade-ul de la WP. Folosesc tot EveryDNS pentru DNS Hosting.
Dar nu am inteles exact cum tb sa fac setarile pe EveryDNS. Deci de la WP am 3 IPuri, la everydns cum le trec? Nu imi e clar pe CNAME sau nu?
merci mult.
Am rezolvat. :)
Am trecut record type A si apoi IPurile de la WordPress.
Acum cumpar si credit la wordpress.
Abia astept sa ma vad pe domeniu!! :)
Da, trebuie introduse ca record type A. Nu uita să setezi din WordPress Admin, la Upgrades > Domains să alegi “Put blog here” pentru domeniu.
By default, WordPress redirecteaza domeniul la subdomeniul din WordPress (adică scrii andreimaxim.ro şi ajungi la andreimaxim.wordpress.com) pe când tu probabil vrei invers.
ok. voi fi atenta.
merci mult de tot, chiar m-a ajutat postul tau.
o sa mai trec pe la tine ;)
Andrei, cu record type A nu merge. Am scris la WP support si au zis ca trebuie sa pun record type NS.
Mai întâi trebuie să setezi nameserverele domeniului tău cu nameserverele de la WordPress. Abia după ce confirmă că setările sunt făcute astfel poţi să plăteşti pentru upgrade-ul de domeniu.
Record type NS se referă la nameserverele domeniului.
Can you post a screenshot of your everyDNS configuration?
nphc67, sorry, but my hosting moved elsewhere and the current configuration wouldn’t help you much.
I tried to follow your advice and as a result my domain points to main page of WordPress.com instead of my blog. :)
Do you have any idea what I may have done wrong?
If you want, I can e-mail you my configuration.
First, you must follow the steps WordPress.com tells you to when you purchase a domain add-on. Something like:
1. Buy a domain
2. Set the nameservers to ns1, ns2 and ns3.wordpress.com (you’ll have to wait about 24 hours on this step)
3. Purchase the domain add-on and wait till everything is up and running
4. Follow this guide.
If you don’t purchase the domain option it’s likely that you’ll see the WordPress.com page.
I guess that must be it since I didn’t buy the domain add-on. I’ll do it.
Thanks for your help!