In past I had this issue on one very important laptop with Windows Vista. Sometimes it happened that local network (file shares, printer,…) was available but internet wasn’t. It was happening accidentally and I was not able to replicate it. Once I found the Default gateway on the network card has changed from DHCP server one to 0.0.0.0 . The solution wasn’t to unplug network cable or to turn off network card and then back on. Temporary solution was to delete the route which was causing troubles but I don’t want to say it was a real solution. It was a quick fix. Anyway I didn’t find anything wrong or unusual on the problematic computer. I was also trying to solve it with Microsoft support but without any success.
Some time passed and then it happened again on a different machine with Windows Seven installed. So I stopped thinking it is a random issue. It was caused by one software.. mDNS responder.. It is a tiny software installed by Bonjour and the solution is to remove (or to disable) this service via the following command
C:\Program Files\Bonjour\mDNSResponder.exe -remove .
After reboot I never had the problem again and I’m recommending it to anybody to prevent issue with this service..
Hope it helps..