In testing Yosemite beta, you may come across a DNS failure, so no webpages load in Safari and apps have no internet. This often happens after the Mac wakes from sleep.
After trying to flush the DNS cache it said the mDNSResponder service wasn't running; so to get things back in action just start the mDNSResponder service again with this command:
- sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
If you don't fancy tapping away in Terminal, a restart will also get this running again.