We will do this in Windows 7 but you can do it in all Windows versions.
This post will use the hosts file and two tasks. The host file is stored in %SystemRoot%\system32\drivers\etc\ and its function is mapping host names and IP addresses. Before DNS or WINS act the local host do this mapping so is the ideal place for controlling access to Web Pages.
So let start: