Not sure your platform but if you're a Windows user, check your windows\system\drivers\etc\hosts file. You can edit it with notepad or similar text editor.
My guess is, you had spyware that added all kinds of nefarious entries that intercept certain domain names, such as google.com, etc. Delete all the entries that redirect to the sites you don't want. Generally, this file has no entries.
You'll need to restart your machine for the changes to take effect. Also, purge your browser cache.