My router has a highly configurable content filter (e.g. a multitude of different categories) which references a server to determine whether a web site (IP address) should be blocked.
I did try it once and it seemed to work OK.
Alternatively just search for content filtering software and you come up with a whole host of options. For example: click here