Unblock Blocked Sites by Changing The Hosts File
Unblock Blocked Sites by Changing The Hosts File
Unblock Blocked Sites by Changing The Hosts File
Hosts File
By Young | Published: August 16, 2012
To unblocked a blocked site (such as Facebook), you can check out VPN, SSH, Proxy and some
other free anti-censorship tools as mentioned before.
In fact, you can even unblocked blocked sites without any third-party tools, but just by changing
the hosts file on your own computer.
The following will show you how to change the Hosts file and unblocked the Facebook site in 3
steps:
For Facebook, Twitter, YouTube and some other big sites, each of them usually has more than
one IP address, so, how to find out all the IP addresses of a site?
You can visit the CacheCheck page of OpenDNS, enter the domain of the site (such as
facebook.com), and click on the "Check this domain" button, then you can see the site's IP
addresses from all over the world.
Among all the IP addresses of the site, some of them may be blocked in your area, while the
others are not, so how to figure them out?
The most easy way is to ping them on your computers. For Windows, you can open the
Command Prompt (cmd.exe), and for Mac OS, you can open the Terminal application, then enter
the following command:
ping 66.220.152.16
The above "66.220.152.16" is one of Facebook's IP addresses, remember to change it to the one
you are going to ping.
If there is a "timeout" error in the result, then the IP address is blocked in your area, if not, then
you are lucky to add it to the hosts file.
For Windows, you can find the hosts file in the following address:
C:\WINDOWS\system32\drivers\etc
And for Mac OS, you can find and open the hosts file by entering the following command on the
Terminal application:
sudo vi /private/etc/hosts
When the hosts file is opened, you can add the blocked site's unblocked IP addresses with
domains in the end of the file. Take Facebook for example, you can enter the following 2 lines:
66.220.152.16 facebook.com
66.220.152.16 www.facebook.com
Besides, you can also add more sub-domains (such as developers.facebook.com) with their
unblocked IP addresses if any.
After that, save the hosts file, then you can visit the Facebook site directly without any anti-
censorship tools, but, you need to use "HTTPS" instead of "HTTP" in the URL, which means
that you need to visit the facebook via the following URL:
https://facebook.com
or
https://www.facebook.com
But, if all the IP addresses of a site are blocked in your area (for example, all the Twitter IP
addresses are blocked in China), you can't unblocked it by changing the hosts file.