If you are having problems connecting to the internet on your Mac, you may need to flush your DNS cache. On Mac OS X 10.7 and 10.8, you can simply open Terminal by using Spotlight (CMD+Space) or by going to Applications > Utilities > Terminal. Copy and paste the command below to flush your DNS Cache:

sudo killall -HUP mDNSResponder 

Type in your Administrative password and the command should fix your internet problems! Hopefully your internet connection problems are gone now and you can enjoy the internet! If you have any questions, please feel free to leave a comment below!