There are ways for doing it depending upon the router and Operating System you running and your background. If your operating system is Unix based system like Linux or Mac then you can add filters in IP-Table to block the sites. There is firewalls available on all the systems you need to configure it as per your need. There are some add-ons to the browsers that will block the desired website.
In spite of above there are some software that can do these things for you easily like Hello Spy, Norton family, DNS Angel, Bit defender Parental control, Net Nanny, web watcher etc. These are easy gui tools(software) that can do the parental control. They may or may not be free.
In latest windows 8 series there is application Family Safety that can be configured to do so but it is for windows 8 onwards only.
Ah, the old "block everything but porn" question... *"Because some software user download may carried some not pornographic messages"*. Or maybe that's a humorous typo... – Xen2050 – 2015-02-06T09:46:44.280