Adding GitHub to Your Hosts File


Here's how to access GitHub despite a DNS outage. This tutorial is for Mac, but the general idea applies to other operating systems, too.

1) Adding GitHub to your hosts file

First, open your hosts file with the following command:

sudo nano /etc/hosts

You don't have to use nano; I'm just using it for this walkthrough. Now add the following lines, with tabs in between each IP and the domain name:

Save with Ctrl+O, and exit with Ctrl+X.

2) Flushing your DNS

This part varies based on the version of OSX you're running. I'd just follow this tutorial:

Now you should be done. Let me know if you run into any issues.

Tags: hosts dns github dyn outage

See also: Fetching XML online and parsing in Objective C

Back to all posts

Neel Somani

About the Author

Neel Somani is the founder of Apptic LLC. In addition to computer science, he's interested in philosophy and entrepreneurship. You can follow him on Google+, LinkedIn, and Twitter.

comments powered by Disqus