Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I create a Group Policy that will prevent my users from accessing specific web-sites? I am at the 2008r2 functional level.

share|improve this question
The thing you want to achive is mostly done by transparent proxy serwer on gateway not by gpo – Alan Kuras Nov 14 '11 at 13:58

You need to set up an outbound proxy (Threat Management Gateway, Squid, etc) and use Group Policy to force Internet Explorer to pass all traffic though this proxy if it is not in-line. If you make the proxy in-line, then all traffic will, obviously, pass through it regardless of IE settings, making the GPO pointless.

You cannot accomplish this natively though GPO without doing something kludgey like making a hosts file on a network share with the appropriate sites blocked and using the Group Policy Preferences file update setting to push it to computers. I really advise against this. Take the time to set up a proxy and do it the right way.

share|improve this answer
This is more of an answer. I would add that if it's not inline, you really should set up Access Control so that your domain computers can not get out without going through the proxy. – Dan Nov 14 '11 at 14:06
@Dan Completely agreed. I thought about adding that, but didn't want to muddy the waters too much. It's a very valid addition, though. – MDMarra Nov 14 '11 at 14:07

There's no built in standard way to achieve this using Group Policy.

share|improve this answer

For a Computer policy, one possible method is to use a hosts file. You could create a custom hosts file that contains the names that you want to block, and deploy that using the Group Policy Preferences feature to copy files. (Computer Configuration > Preferences > Windows settings > Files).

Keep in mind that this approach may not offer the granularity desired in all scenarios, and you cannot block a tld in a hosts file, only specific names. It may also not be appropriate if the hosts file is in use for other pre-existing names. A typical entry may be: localhost  

Some domains are difficult to block due to the large number of host names and different fqdn's required.

For the file source, you could specify:

\\\SysVol\\Policies\{GPO guid}\Machine\Preferences\Files 

And be sure to copy the modified hosts file to that location.

File destination would be: %systemroot%\system32\drivers\etc\hosts

The "Action" would be "Replace".

Note that the normal group policy refresh applies to this GPO. Testing has conformed that the file will be re-copied at the normal interval (by default, 90 minutes for a computer gpo).

share|improve this answer
The downside to this (besides the terrible manageability) is that is a user is an administrator, it can be circumvented easily. – MDMarra Nov 14 '11 at 20:06
That downside would apply to any GPO. All group policies are easily circumvented by someone with administrator permissions. – Greg Askew Nov 14 '11 at 20:32
Some more easily than others. Group Policy File Preferences only apply at logon, others refresh at the specified background interval. – MDMarra Nov 14 '11 at 20:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.