Sorry was busy all weekend.
Instead of running ping, I would have run nslookup. You can type nslookup and press enter. Once it is started, nslookup will tell you the DNS server you are using and the IP address. Mine is 192.168.1.1.
If that doesn't produce an error, you can type in an address like
www.bbc.co.uk and it will either tell you that it has found the address or it will throw an error.
You can also change DNS servers, AS WM suggested. If you type
SERVER 8.8.8.8 and press enter, it should return and tell you the server is ready.
If, at any time, the DNS tells you it has a problem finding the server (Time Out etc), then you have a problem.
Other things I would do with a computer which was working.
In the same command window type
ipconfig /release press enter
ipconfig /renew press enter
It is usually something small which causes these problems.
The other thing to do is reboot the router. In case it is unhappy and refusing to connect for any reason.