Blocking sites in a zone file

Julius Huang juliushuang at gmail.com
Sat Mar 1 10:06:52 UTC 2008


On Feb 28, 2008, at 14:52 , Evan Platt wrote:


> So I use my OS/X 10.4 server as my DNS server for my LAN.
>
>

I use Tiger on Powerbook G4 with bind 9.


> I figured instead of using a hosts file on my desktop machines, why
> not have the hosts file essentially on the Mac as the Mac does the
> DNS?
>
> I looked at
>
> 127.0.0.1 somespamsite.com to
>
> zone "somespamsite.com" { type master; notify no; file
> "null.zone.file"; };
>
> I looked at http://pgl.yoyo.org/adservers/hosts2bind.php . You can
> paste a hosts file and it will convert it from say
>
> 127.0.0.1 somespamsite.com to
>
> zone "somespamsite.com" { type master; notify no; file
> "null.zone.file"; };
>
> so where do I place those entries?
>
>

Put it in your "named.conf".


> In my /private/var/named, I have
>
> -rw-r--r--  1 root wheel  200 Jan 22 15:59 192.168.1.3.rev
> -rw-r--r--  1 root wheel  230 Feb 27 15:43 db.127.0.0.1
> -rw-r--r--  1 root wheel  229 Feb 27 15:42 db.127.0.0.1.bak
> -rw-r--r--  1 root wheel  433 Mar 24  2007 db.127.0.0.1.dist
> -rw-r--r--  1 root wheel 2517 Mar 10  2007 db.cache
> -rw-r--r--  1 root wheel  632 Feb 27 15:53 espphotography.com
> -rw-r--r--  1 root wheel  337 Mar 10  2007 espphotography.com..bak
> -rw-r--r--  1 root wheel  629 Feb 27 15:53 espphotography.com.bak
> -rw-r--r--  1 root wheel  121 Mar 10  2007 localhost.zone
> -rw-r--r--  1 root wheel 2517 Mar 10  2007 named.ca
> -rw-r--r--  1 root wheel  180 Mar 10  2007 named.local
>
> Do I simply add the zone "somespamsite.com" line into one of the
> above? The link on yoyo.org says into named.conf .
>
> I added
> www.acezip.net	IN	A	127.0.0.1
> into named.conf, and when I restart named, I get in my system.log
>
>

If you want to block acezip.net,
   put below in your named.conf,

    zone "acezip.net" { type master; notify no; file
    "null.zone.file"; };

BTW, can you show us your null.zone.file and your named.conf

In the last line of my named.conf I put include named.conf.local  
(Black list).
I had a 3 line script to generate named.conf.local from the yoyo.org  
list.

J.


> Feb 27 22:51:50 espphotography named[12846]: starting BIND 9.4.0
> Feb 27 22:51:50 espphotography named[12846]: /etc/named.conf:72:
> unknown option 'www.acezip.net'
> Feb 27 22:51:50 espphotography named[12846]: /etc/named.conf:74:
> unexpected token near end of file
> Feb 27 22:51:50 espphotography named[12846]: loading configuration:
> unexpected token
> Feb 27 22:51:50 espphotography named[12846]: exiting (due to fatal
> error)
>
>
> Any help appreciated...
>
> Thanks. :)
>
> Evan
> -- 
> To reply via e-mail, remove The Obvious from my e-mail address.
>


More information about the bind-users mailing list