make sure in System Preferences > Network > WiFi &/Or Ethernet is obtaining an IP address. the wifi or ethernet might a yellow color( it will say you are connected to the internet but can't obtain an IP address or something of that sort in the smaller text ) instead of a green ( connected) look and make sure IPv4 says "using DHCP". not " Not Connected" or anything else for that matter. after you have made sure it says "Using DHCP" hit advanced option and then hit "Renew DHCP License" click ok and make sure you hit "Apply" . If that was the issue, right after you hit Apply. you should obtain a new IP Address and then it will turn to "Connected"
make sure you are connected to the internet when you perform this. Hope that helps.
I also noticed for some reason there was 1 time it wouldn't obtain an IP Address until i connected to my VPN Server. so maybe something else to try if you have setup a VPN try connecting to one of there servers and see if that does anything.