Sometimes the DNS gets messed up.
Open a command prompt. Go to Start, Run, then type CMD and hit Enter.
A new window should appear.
In the window, type the following :
ipconfig /flushdns
Then hit Enter.
The message should say "Successfully flushed the DNS Resolver Cache."
Then try to access the internet, it may now work. That has fixed my problem on several ocassions.