Everyday I receive many emails in my inbox asking for ways to access blocked websites like Facebook and Twitter. It seems like more and more governments are blocking social networks to control the flow of information tightly. According to what I know, China, Vietnam, Iran, Uzbekistan, Pakistan, Syria and Bangladesh have already banned Facebook completely. Those are the reasons why people in these countries have to find indirect ways to access to Facebook.
I mentioned 7 ways to access blocked Facebook in a post last year and still update it regularly with working solutions. However, I forgot that those are tips for Windows only, so many readers have emailed me and told that they don’t know how to apply those tips for MacBook. I am sorry I can’t reply all your comments and emails, hopefully you will find this post useful. Check out the simple steps below to access restricted Facebook on Mac OS X.
Step 1: Open Terminal
We can open Terminal either by typing Terminal on the Spotlight, or by navigating to Applications – Utilities – Terminal.

Step 2: Edit Hosts File
The Hosts file is the text file mapping particular hostnames to certain IP addresses. When you type in a URL address on Safari, the system will check in the host files to see if there is a relevant entry. If there is, it will get the corresponding IP address, else it will move on to the DNS server to find the IP address.
Now we need to open the Hosts file to edit it. Type in the following command in the Terminal:
sudo nano /private/etc/hosts
Enter your administrator password when prompted.
The hosts file will be opened for editing.

Next, add following lines to the bottom of this file:
153.16.15.71 apps.facebook.com
125.252.224.88 facebook.com
125.252.224.88 www.facebook.com
153.16.15.71 login.facebook.com
153.16.15.71 graph.facebook.com
153.16.15.71 static.ak.connect.facebook.com
153.16.15.71 developers.facebook.com
153.16.15.71 error.facebook.com
153.16.15.71 upload.facebook.com
153.16.15.71 register.facebook.com
153.16.15.71 bigzipfiles.facebook.com
153.16.15.71 pixel.facebook.com
153.16.15.71 0.132.channel.facebook.com
153.16.15.71 1.132.channel.facebook.com
153.16.15.71 error.132.channel.facebook.com
Press control-O to save the file.
Step 3: Flush DNS Cache
To make the changes take effect, we then need to flush the DNS resolver cache. Enter the following command in the Terminal:
dscacheutil -flushcache
You now can exit Terminal and access Facebook like normal. Leave a comment below if you have any problem.
Just made a change and working well. Thanks for it.
Hi Tuan, it does not show the host file after i typed in the command for ‘sudo nano/private/etc/hosts’.
Hi,
There should be a space between nano and the slash.
Hi Tuan, Thank you so much! It works, although its slower than before or if not, being access denied.
Hi Anh Tuan,
I used this method to access facebook when i was in Vietnam, but now I just got back to U.S and figured out that I can’t access to the facebook app (poker…), and couldn’t upload pictures either. How can I re-set this, and make it normal again? If you know the solution, please send me an email.
I will appreciate so much.
Thank in advance!
I also have the same problem as Hao Nguyen. I couldn’t upload pictures to facebooks since I got back to the US. Could you please show me the solution? Thank you so much.
me too..I also have the same problem…
Can you help me??
Hi, may I have the instructions to reset as well? Thanks, L
Hey,
Thanks for posting this, but when I enter “sudo nano /private/etc/hosts” it doesnt ask me for a password and I cant get further. Any ideas of what I should do?
LH
That’s strange,
So you can try this way: Go to Folder, type in /etc, then open the hosts file here to edit. That should work.
Hi there:
Thanks for the advice.
After I type in sudo nano /private/etc/hosts
it does prompt me to enter my password but strangely I cannot type it in, like the keyboard doesn’t work.
In your answer of March 8 you said to go to Folder and type in /etc. Sorry, but I don’t know where Folder is and what to type in.
Can you help me out here?
Thanks,
S
Hi Sukie,
You could use the Go -> Go to Folder command from the Finded on top. I don’t know why you can’t type in your password.
Good luck.
Hi Tuan,
I faced the same problem as well.. I can’t type in my password, and when I tried to relaunch the terminal, it became blank.. When I put in the command, nothing happened.
Then I tried to edit the host file by searching for the file in /etc. But when I tried to save the doc, it said that the host file cannot be saved.
Hope you can help me with this problem..
Thanks
Nina
Hi Nina, you can try this solution:
- Copy the hosts file into another folder.
- Edit it like above.
- Save it.
- Put the new file into /etc.
- you’ll be asked to authentify with your admin password.
- It’s finished.
Hi Tuan,
It’s done, but there are no pictures and I can’t even post anything.. It’s just look weird..
Thanks and have a nice weekend
For those who cannot type in the password in terminal – there is a simple reason for this – ANY password Terminal asks you to enter will not display, this is for security reasons (so anyone near you that may be watching won’t be able to see what your password is). Go ahead and type the password just like you normally would and hit enter when you are finished. You won’t see it, but that’s okay
Tuan – I posted this comment twice to make sure you see it – I saw that several people posted comments about not being able to enter their password and I figured you and your readers would appreciate knowing what was going, why it was happening, as well as an explanation that would allow them to get to the next step.
You should publish/put this info in your instructions – it seems like a lot of people don’t seem to realize that this is just a part of how Terminal works. Cool article by the way, I’m sure it will help a ton of people to get around the stupid censorship their frightened government puts in place; which is AWESOME!!!!!!!!!
Hi Tuan – cheers for this. All seems to work fine except the site only comes up in Text format, which makes it impossible to access the site using the capchta when it requires you to verify your identity. Any ideas why it’s text only and how to get around this?
Thanks in advance!
Joe
Hi,
I also had this problem a few weeks ago. I cleared all browser cache, flush DNS cache and then all are displayed correctly like normal.
Good luck, Joe.
Hi Tuan – thanks for getting back.
Just a couple of questions: When you say you cleared all browser cache do you mean you did this in Firefox?
I’ve gone to Tools> Clear Recent History> Clear Now.
After this, I’ve gone back in to Terminal and entered the “sudo nano /private/etc/hosts” command. Then it shows the code you wrote on the instructions. Then I hit Control + 0, and I get: File Name To Write: /private/etc/hosts.
I press return and I see the code you suggested we put in on the instructions above. Do I need to re-enter the terminal via the “sudo nano /private/etc/hosts” command or do I do it as soon as I’ve pressed Control + O in order to flush the cache by entering “dscacheutil -flushcache”?
Sorry about this mate, but could you break it down in to steps as you did above? I’m still only getting text displayed for some reason!
Thanks again,
Joe
Hi Joe,
I think you did all those steps correctly. You should be able to access to Facebook now. Btw, have you changed the DNS Server on your Mac? If you haven’t, check it out in the comment section of this post: http://tek3d.org/the-simplest-way-to-access-blocked-facebook
i’m having the same problem as you mentioned here, with the facebook page loading but with no images/pictures, just text. i tried flushing the browser (firefox) and dns cache using the instructions provided but it hasn’t changed. any chance you have any other tips or that i’m missing a step?
cheers
karl
Mate – you’re a champion. Worked a treat! Thanks a million for that. Really appreciate it!
Tuan,
Honestly, I don’t have any idea how to touch my Mac’s host file LOL..
Yes, I use both Mac and Windows, I am strange
But mostly I work with windows, and I definitely know where my host file in windows and how to access it, but not in mac.
Thanks for this tutorial, will check out later again if I have the issue with FB.
LOL, Facebook is blocked in your country too?
I also use a Windows laptop for my work, so I had to borrow my brother his MacBook to write this tutorial.
Btw, why don’t you change the structure of your blog? I visit your blog sometimes and thought that it hasn’t been updated since October last year.
Tuan,
Not in Germany, where I am living in.
But where my home country is, Indonesia, since Twitter was blocked, could be facebook too, not sure
Oh those two post are stickies
always shows on the top lol..
Same here then, I am also a window user, still don’t get used to a mac
Thanks.
How do I reset it to normal after leaving Vietnam? I’m back on North America and I want my old settings!
You just need to delete the lines you added to the hosts file. Good luck.
Works like a charm. Thanks Tuan
I deleted those lines in the terminal but facebook is still not showing pictures as it did when i was in vietnam. Help..
Hey man,
Sorry if this questioned has been asked or answered before. I have just switched to using a mac and am pretty incompetent with it.
I entered the “sudo nano /private/etc/hosts” and then after i entered my password. It brings me to the page you said. “## host database…” etc.
I then copied the code you gave me and entered it at the bottom of the file and pressed “control o”.
It comes up with the “File Name To Write: /private/etc/hosts”
I pressed return and it seems to save. (it also say something like “read 25 lines” after i saved it).
Now, do i immediately enter “dscacheutil -flushcache” or do i have to exit first and then enter the command?
Sorry, everything seems to work like u said until after i save the file. I have already changed the DNS server like you said in your other post, or at least i like to think i have.
Any help would be greatly appreciated.
jack
Hi Jack,
You just need to save the file, close it and then type in the command to flush DNS cache. I think it should work now.
Regards.
Hi Tuan,
Do you mean that close terminal file and then open it to type the command?
I tried to do this but it still doesnt work.
Hi Trang,
I meant you just need to close the file hosts and then type the command to Flush DNS cache in Terminal. It should work for you then.
Hi Tuan,
Finally it works. However, I cant change my profile pics eventhough I tried so many times
Hey, I am in a boarding school which facebook is blocked by a proxy server. Will this work? because everytime a try it it just says it cannot coenenct to the itnernet
Hello there,
I am trying all that you have mentioned. When I type “sudo” etc…I can’t insert a passport, the keyboard doesn’t work, but anyway I have no clue how to get this password anyway as It was the first time I tried that. Then I tried go to folder in/etc and it didn’t work either, it says command doesn’t exist….Please help me! I am going crazy with this mac! What else can I do? Thx
learn to use command line in Mac first
you should read the comments above, the password you type won’t show up on screen for protection, just type your pass normally and press Enter