Take the 2-minute tour ×

Is there any linux DNS server software the will block certain sites at a particular time of day?

share|improve this question
Its a bit odd to ask how a DNS server that functionally provides access is meant to be used to deny access. By simply not allowing it to resolve at all it in effect blocks access. If you are using a Linux machine for DNS resolution you may be able to get away with dynamically adjusting the DNS settings by doing a cronjob of deleting the means of resolving particular websites at certain times and readding them at the times you like. I am sure this can be done with Windows too, but I am not very strong in task scheduling and manipulation of timed program execution in Windows. –  Stephen R Jul 12 '12 at 16:58

3 Answers 3

up vote 1 down vote accepted

I think what you are looking is a proxy software that will allow you to deny/allow http requests. Squid, should work for you. Please note this isn't exactly trivial using setting up the config file. However, I did find a post that might be relevant to your specific problem.

As Hennes eludes to, DNS only services name resolutions (transforms www.google.com to

share|improve this answer

DNS can not block access. It can refuse to resolve or return a different host.

Both of those might not work as expected if the client caches DNS information.

Example: You have a site which should only resolve between 9AM and 5PM

  • Client tries to go to the site at a minute before 5PM, this works.
  • Client reload the site 10 minutes later (now after the 5PM deadline)... it will still works.

An other example:

  • Client tries to access the site at 8AM and gets the redirected to a different host.
  • Client tries again after 9AM. The information is still cached and the client gets redirected again.

I am not sure what goal you want to achieve, but if you want to block sites from a coorperate network you might want to look at proxy software.

share|improve this answer
Plus, a user can always use an alternate DNS server. And if you're blocking outbound DNS requests from everything except your DNS server, the user can always tunnel the DNS requests through a proxy. –  Darth Android Jul 12 '12 at 14:25
… or the client could just use the IP address instead. –  slhck Jul 12 '12 at 15:01
I know it can't block access, (the US government doesn't know that, but I do!) I just thought that it would work well to keep a non-technical user from gaining access at certain times of the day. Okay so I should be using a proxy instead... :-p –  leeand00 Jul 12 '12 at 18:31
It should work for non technical persons. But if a person can google then he or she will discover how extremely easy it is to avoid it. And once one person knows it will spread. Then there is the caching part which might mess things up. And thirdly a proxy can do many useful things. Not just block stuff, but also do what it was originally written for: Speed things up and lower bandwidth. Sadly I never saw it used for the latter two reasons. –  Hennes Jul 12 '12 at 19:56

A solution can be to use your own webserver that runs a script to check the time, if it's within the time range forward the request to the actual server, if it's not return stuff like 403 or 503. Then use DNS to hijack the actual site.

share|improve this answer

Your Answer


