DNS doesn't work properly in OS X Yosemite
I experienced that problem on my MBP as well. I suppose it's a bug in Yosemite.
Here's a related question: Yosemite cannot resolve domain names maybe it gives you some insight 

My work around is flushing the DNS cache:

sudo discoveryutil mdnsflushcache


if that command doesn't work try this one instead:

sudo discoveryutil udnsflushcaches


I am not sure if this helped fixing it, but I did a PRAM and SMC reset as well.