#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2011
    Posts
    1
    Rep Power
    0

    Help with BIND DNS for Content Blocking


    Hi,
    For the LAN I want to redirect blocked domains to a block page on my local server, on a local IP of 192.168.1.104. I've got the server (Apache) setup to handle wildcard requests so that they go to the block page, but I'm a bit lost as to what to do with the DNS. Currently in 'named.conf' I've got at the bottom the domains I want block, so for example
    Code:
    zone "blockeddomain.com" in { type master ; file "block.bind" ; } ;
    which I'm pretty sure is fine since it's blocking it, but as for the 'block.bind' file I'm not really sure what to do in regard to wildcards. Currently it's like this;
    Code:
    @ IN SOA ( ns1.domain.com. hostmaster.domain.com.
               1 10800 3600 86400 21600 )
      IN NS  ns1.domain.com.
    
    *	IN	A	192.168.1.104
    But I know that's wrong. Anybody have any ideas?
    Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Posts
    248
    Rep Power
    5
    Code:
    @ IN SOA ns1.domain.com. hostmaster.domain.com. (
                     1 
                     10800 
                     3600 
                     86400 
                     21600 )
    
    @  IN NS  ns1.domain.com.
    
    *	IN	CNAME	@
    @     IN      A      192.168.1.104
    That might be the easiest way. You don't need the CNAME, you can make that an A record as well. With this set up, you will get the domain and any subdomains as well for the blocked domain.

    The problem before was if you have just the wildcard, you are only "filtering" the subdomains, the actual domain name needed an A record as well. And your parenthesis was in the wrong spot. Oh and if you specify no ttl at the top, it will use your minimum field in the SOA for the default ttl. No big deal on that probably.

IMN logo majestic logo threadwatch logo seochat tools logo