You can block or redirect a website using settings on your firewall or router. But did you know that you can block or redirect websites using Active Directory Domain Services (DNS) as well? Just use these steps.
This tutorial assumes you have Administrator rights in your Active Directory Environment, with access to Microsoft Management Console.
Creating Forward Lookup Zone
- Select “Start“, type “mmc.exe“, then press “Enter“.
- The Microsoft Management Console appears. Select “File” > “Add/Remove Snap In…“.
- Add the “DNS” snap in, then select “OK“
- Select “DNS” on the left pane. You should be prompted to “Connect to DNS Server“. Select “This computer” if you’re logged into the DNS server, or select “The following computer” and enter the domain name or IP address of the DNS server you wish to connect to. Select “OK” when you are done.
- Now expand the server name under DNS and right-click “Forward Lookup Zones” and select “New Zone“.
- The New Zone Wizard appears. Select “Next”.
- Select “Primary Zone“, then select “Next“.
- Select “To all DNS servers running on domain controllers in this domain“, then select “Next“.
- For the “Zone name“, type the URL for the website you wish to block (i.e. facebook.com, reddit.com, etc.), then select “Next“.
- Select “Do not allow dynamic updates“, then select “Next” > “Finish“. You now have set a Forward Lookup Zone that will “take over” any requests to that domain on your network.
Note: It may take time for this setting to propagate to clients. You may want to restart, or use the ipconfig /flushdns command to be sure DNS queries are not cached in any way.
Redirecting the URL
If you would like to redirect the URL to another URL, you can use these steps:
- Expand DNS and “Forward Lookup Zones” in the MMC console.
- Right-click on the zone you created, then choose “Other New Records…” > “Domain Alias (DNAME)” > “Create Record…“.
- Leave “Alias name” blank. For “Fully qualified domain name (FQDN) for target domain“, type the URL for the site you would like to redirect to, then select “OK“.
Now any time somebody tries to go to the web address you set the Forward Lookup Zone for, they will redirect to the new target domain.
What if I need to exclude certain users from this restriction? how can i do that?
I want to prevent end users to restrict one application during 7:AM to 9:AM. This application is installed on all the end user Desktops/Laptops..
Can I schedule this restriction?