Nasty websites? You got a list of those to avoid? /s
The ones you visit.
This does exist. There are plenty of "hosts file" websites that aggregate a list of bad websites including everything from malware and spam to porn and advertising websites.
You copy the text file to your Windows\system32\drivers\etc directory, and any sites in that list will redirect to your local machine.
Be forewarned, the lists are often very large (>5 MB) and can significantly slow down your website browsing. There are better tools out there, but this one's fool proof, as it never lets the traffic leave your machine to begin with.