Custom Domains

on GitHub Pages

There are numerous different ways to "host" your projects on the World Wide Web so that they may be accessible to anyone with an Internet connection (in class we even discussed how you could technically host it yourself at home). Typically you pay some company, known as a "hosting provider", to rent some space on one of their computers running a sever which you can upload your projects to. These are usually paid services, but because we're using GitHub as our open source code portfolio, we can take advantage of their free hosting service called GitHub Pages.

Hosting Your Project on GitHub Pages

If you're using netnet to create your project, you can ask it to "publish" your project for you and it will enable the GitHub Pages feature on your behalf, but if you'd like to enable the feature yourself go to your project's "repository" page on GitHub and do the following:

  1. click on your repository's Settings tab.
  2. in the side panel menu choose Pages
  3. make sure your "main" branch and your "/ (root)" folder are selected (they should be by default) then click Save

GitHub should automatically generate a custom URL for you which should be live a couple of minutes afterwards (if you click that link immediately you will probably land on a 404 page, it takes a minute or two before the page is actually live). If you'd like your own custom domain name you'll have to buy one. As we discussed in class during our Internet Travelogue workshop, all servers run on computers connected to the Internet, these computers all have an IP address. The GitHub Pages servers run on computers with the following IP addressses, 185.199.108.153, 185.199.109.153, 185.199.110.153 and 185.199.111.153. Because it's not easy to remember IP addresses, we use domain names to access these websites, the Internet's Domain Name System (or DNS) is like a giant "Contacts List" or "Address Book" which keeps track of all the domain names and which IP addresses they point to. In GitHub's case, because their GitHub Pages servers are hosting lots of different people's websites, they also use this domain name to differentiate between the different projects hosted in their data center. For this reason, they will automatically generate a domain name for you, usually something like https://YOUR_USERNAME.github.io/YOUR_PROJECT, but you can also register your own cutsom domain name if you prefer.

Custom Domain Names

In order to register a custom domain name, you need to pay a registrar to add that domain to the DNS (or some company that will register it for you). There are loads of company's that will do this, my personal preference these days is namecheap.com. You can register your domain for a year (or more), but keep in mind, once that time runs out (and your registration "expires"), anyone will be able to purchase that domain (so it's best to set "auto-renew" if your registrar provides that feature). Once you've registered the domain you want, you'll need to let your registrar know which IP address you'd like it to resolve to. This looks a little different depending on which company you used to register your domain, but if you used namecheap, you can follow these instructions for how to link your domain to GitHub Pages.