Sometimes its due to ip conflict with your wifi and lan.. Just follow these steps
Open Network & Sharing
Click on the wifi u r connected
Go to properties
Now click on IPV4 and again click properties of it. Click advance at bottom and go to DNS.
If you find any ip there delete it.. Your net will now work fine