The Devil is in the DNS

The title of this post actually doesn’t ring too many front-end web developer bells. In fact,”DNS propagation” sounds like some web administrator buzzword. It stands to reason, however, that since I have a hand (and in most cases the only hand) in a few websites (including this website), I have some experience with websites behind the scenes.

That’s right! I can FTP, I can mess with the .htaccess file, I’m not the definitive worst person behind a bash console, but what I will tell you is that all that experience, all the knowledge and theory means nothing comforting when you decide to do something drastic. In this case, I moved a website to a different host.

Pixelkin, one of the awesome companies I do work for, as well as a group of people that I love dearly, had been running a website under Dreamhost since last November. At the outset, it wasn’t so bad. Traffic wasn’t high, the theme wasn’t the most complex thing, and nothing felt bloated. One of the problems that was introduced over the coming months was the problem of scalability, which is a non-functional requirement in the software development world ensuring that no matter how ‘big’ something gets, it still feels light and elegant.

Scalability became a huge problem.

Now, I’ve got to say here that I’m very fortunate to run into a problem like this. In my line of work I’m usually constrained to writing markup, making it look great, and making it usable. With Pixelkin, I’m not just a web developer, I’m an anti-catastrophe engineer. It’s my job to make sure that the site isn’t slow as molasses and that it’s not in shambles at any given time. This opens me up to some opportunities I wouldn’t otherwise have

Anyways, after exhausting several options including my own research into Cloudflare, WordPress caching plugins, and even upgrading to a premium Dreamhost package, I decided enough was enough, and begin researching for alternatives.

I eventually stumbled onto Digital Ocean, a VPS (virtual private server) hosting service that had plans that were not only cheaper than what we were being gouged for at Dreamhost, but all of the Digital Ocean VPS servers had a solid state drive to pull from in addition to their impressive specs. Pixelkin practically improved its load time on all fronts. After seeing that performance difference, I decided Digital Ocean was right for us.

The process for switching your website to a new location really depends on your needs, but in my case, we were dealing with a situation where we just wanted to host the site somewhere else, and keep the domain name registered to its current registrar (Dreamhost). Now, when you have your website duplicated in another place, at another host, You need to set up hostname records on your new host location, and then change your nameservers. This entails going through your domain registrar and effectively telling them “Hey, my site files are now over here”.  Once the process starts, your registrar will begin the process of routing traffic to the new location, and provided yourDNS Records are in order (that is, you have the proper A,  AAAA, MX, etc records), you’ll slowly start to see a change in where users are brought when they type your domain in.

Now, one thing I love about being a web developer is the instant feedback I get when I make a change.

However, the feedback was far from instant when I changed the nameservers for the pixelkin.org URL. DNS propagation, which is the process by which a URL is pointed to files that exist at a new location, takes up to 24 hours. I had to sit and panic as I was switching the URL over. hoping that I didn’t catastrophically ruin the site.

I ended up staying up for about 5 hours later than I wanted to. I don’t know what it was, but I wanted the gratification of seeing the website at the new host. By the time 3am hit, I was spent, but I was finally able to see the DNS propagate to the new location.

The lesson here is that it’s worth it to take time to learn how websites and URLs actually work in relation to one another. Oh. and patience. Patience is probably the biggest lesson.

I may have been afraid to transfer a website before, and I’m glad I got the chance to. Opportunities to jump out of my comfort zone to learn something new is a thrilling journey. After an experience like this, I don’t think fear of transferring websites will be an issue.

Written on August 24, 2014