Thoughts of Geoff

Some writing by Geoff Petrie

Adding a CNAME to Your Octopress Blog

This option isn’t terribly well explained in the Octopress documentation, and slightly confusing within the Github.

So that I could get to work as my url to my Octopress blog hosted by Github at, I needed to go to my current hosting service. In my case this is currently Dreamhost.

Since I wasn’t changing my top-level domain (TLD), I wanted to keep pointed at my hosting service, I wanted to add a subdomain, i.e., blog to my domain name server (DNS) run by Dreamhost.

I went into the DNS configuration in the Dreamhost cpanel and added blog as the name/record, CNAME as the type and as the value.

This is the first step, and once the DNS is refreshed your new subdomain (in my case will start pointing to a Github 404.

The next step is to add the CNAME to your Octopress master branch. This is surprisingly simple, but not completely intuitive. In the top level of the source branch, you want to use the command:

echo '' >> source/CNAME

Of course you’re going to use your own subdomain instead of This command will create the CNAME file in your source directory with the url that you want to direct people to.

After this all that’s needed is rake generate and rake deploy. (You may as well commit to your source branch after this.)

Wait a couple of minutes for things to work their way through DNS and Github’s world and you’ll be looking at your Octopress blog on your own domain.