How do I block the entire Internet except a few 'whitelist sites'?

You can consider Privoxy, available from the Ubuntu Software Center. It's a proxy server that may do what you want. Section 3.27 has this:

3.27. Can I set-up Privoxy as a whitelist of "good" sites?

Sure. There are a couple of things you can do for simple white-listing. Here's one real easy one:

############################################################

Blacklist

######################################################

{ +block } / # Block all URLs

############################################################

Whitelist

######################################################

{ -block }
kids.example.com
toys.example.com
games.example.com
This allows access to only those three sites by first blocking all URLs, and then subsequently allowing three specific exceptions.

Another approach is Privoxy's trustfile concept, which incorporates the notion of "trusted referrers". See the Trust documentation for details.

These are fairly simple approaches and are not completely foolproof. There are various other configuration options that should be disabled (described elsewhere here and in the User Manual) so that users can't modify their own configuration and easily circumvent the whitelist.