This post will show you how to edit the hosts file in Mac OS X v10.9.1 (Mavericks) to access Facebook in the countries which block Facebook (China, Vietnam,..).
1. Open the Terminal.app by typing Terminal in the Spotlight search, or go to Applications > Utilities > Terminal:
2. Open the host file by typing below command in the Terminal:
$ sudo nano /private/etc/hosts
Input your password when prompted.
3. The hosts file contains some comments (lines starting with the # symbol), as well as some default hostname mappings (e.g. 127.0.0.1 – local host). Simply append your new mappings underneath the default ones.
In this case, copy and paste following lines into the file hosts:
173.252.110.27 facebook.com
173.252.110.27 www.facebook.com
173.252.110.27 www.login.facebook.com
173.252.110.27 login.facebook.com
173.252.110.27 apps.facebook.com
173.252.110.27 graph.facebook.com
173.252.110.27 register.facebook.com
173.252.110.27 vi-vn.connect.facebook.com
173.252.110.27 vi-vn.facebook.com
173.252.110.27 static.ak.connect.facebook.com
173.252.110.27 developers.facebook.com
173.252.110.27 error.facebook.com
173.252.110.27 channel.facebook.com
173.252.110.27 register.facebook.com
173.252.110.27 bigzipfiles.facebook.com
173.252.110.27 pixel.facebook.com
173.252.110.27 upload.facebook.com
173.252.110.27 register.facebook.com
173.252.110.27 bigzipfiles.facebook.com
173.252.110.27 pixel.facebook.com
173.252.110.27 logins.facebook.com
173.252.110.27 graph.facebook.com
173.252.110.27 developers.facebook.com
173.252.110.27 error.facebook.com
173.252.110.27 register.facebook.com
173.252.110.27 blog.facebook.com
173.252.110.27 channel.facebook.com
173.252.110.27 connect.facebook.com
173.252.110.27 bigzipfiles.facebook.com
4. When done editing the hosts file, press Control-o to save the file.
Press Enter on the filename prompt, and Control-x to exit the editor.
5. Flush the DNS cache
Once you have modified your hosts file, you can flush your DNS so that you can see your new changes more quickly by using following simple Terminal command:
$ dscacheutil -flushcache
0 comments:
Post a Comment