basically you want to do content filtering.
The content filtering included with routers is quite basic to keywords in the address usually. There are some more complete solutions that include a proxy based aproach and a database. I am familiar with these systems for enterprise but not for home or small networks. However entering the terms "free content filtering" on google resulted in some interesting results.