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.
Look, clearing the history and deleting the cookies and all of that stuff, if the problem remains it means that there was a script putting info in your registry, so simply open the REGEDIT and check for the information undet \HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer
under Main and Search and erase the lines wich are indicating the malicious pages.