MacBook Pro sometimes freezes after waking from sleep
This is an often reported problem (with Yosemite) that has been fixed recently.

As of OS X 10.10.4, released yesterday, Apple reinstated mDNSResponder to handle DNS processes previously assigned to discoveryd since the debut of OS X 10.10 Yosemite.

For more information see: http://appleinsider.com/articles/15/05/26/latest-os-x-beta-ditches-buggy-discoveryd-dns-service-replaced-with-mdnsresponder

The best way to fix this problem is to update to 10.10.4.