No extra cost for using a custom domain.

To have a website online you need two things: a domain and a host. I’m assuming you already bought a cool and cheap domain on Namecheap (they’re great). Now the only thing missing is a place to host your website.

$1 buys you an online presence for a whole year!

I wanted to publish a really simple landing page to test an idea. There are several companies that help you designing and hosting landing pages without any coding. They look free but ALL of them will charge you to use a custom domain.

Then I found GitHub Pages. 😍

Publish Push your static website to GitHub Pages

You know the drill: create repo, commit html/css/js files, push. Visit your repository on GitHub. Go to Settings > GitHub Pages > Source. Select the master branch option.

You should be able to view your site on a url like username.github.io/repo . That’s not fancy. Let’s change it to your awesome domain.

👉 Prepare GitHub Pages to use a custom domain

Create a file named CNAME . Add a single line with domain.com . Commit and push. Visit your repository on GitHub. Go to Settings > GitHub Pages > Custom domain. Input your domain.com .

👉 Point your custom domain to GitHub’s servers

GitHub has an official guide to do this. Here’s what worked for me:

Visit your domain provider (e.g. Namecheap). Find the DNS settings (e.g. Domains > Advanced DNS). Create two A records. For Host type @ (that means root or baseline). For Value type the IP addresses you saw on GitHub’s guide. Create an additional CNAME record. For Host type www . For Value type your-username.github.io. . Mind the final dot.

Leave in the oven for 30 minutes or 24 hours

With DNS I’m never really sure how much time to wait. The first time I tried it took one day to update. The next time it only took 15 minutes and a browser cache reset to start working.

Props to GitHub for having a service like Pages and their awesome support that really helped me get on the right track.