Why will my Mac only load Google and Facebook?
Solution 1:
In my case the problem was IPv6. Websites like Facebook, Google.com and Youtube use IPv6 and work fine while other's don't support it yet.
I couldn't figure out the issue exactly (and the right configuration for IPv6) but I disabled IPv6 and the issue was resolved. This is all I care at this point.
The commands for El Capitan:
Turning off IPv6 support for ethernet:
networksetup -setv6off Ethernet
Disabling IPv6 for wireless:
networksetup -setv6off Wi-Fi
If you ever need to re-enable:
networksetup -setv6automatic Wi-Fi
networksetup -setv6automatic Ethernet
I will edit this if I ever find the correct setting for IPv6 instead of a full disable.
Solution 2:
This may unique to my case, but I had exactly this problem today. My Macbook Pro (OSX 10.9.4) started to not connect to anything except google and facebook. No other websites worked. This happened at home and it happened with both wireless and ethernet connections. I took the computer into my office thinking it might be my home ISP, but same problem at the office. Then I remembered that yesterday I reinstalled a Cisco VPN client. As soon as I uninstalled it, everything started to work again - both in my home and office, wifi and ethernet.
Solution 3:
I've tried all of the above with limited success (sometimes works, sometimes does not).
The reason why you are able to load Google and Google-owned sites and bigger players like Facebook is because they use IPv6 and not only IPv4.
The issue seems to occur almost every time I wake my Macbook from sleep.
The only solution I've found to work instantly and every time is going into Preferences > Networks > Click the lock icon & enter your password > Advanced > TCP/IP > Click "Renew DHCP lease".