i have a problem with the internal caching
dns getting confused and thinking that google's
ip is something wierd like 192.168.0.1 or
205.185.192.1.  since the list of ip addresses
google uses for google.com is fairly well-known,
it's easy enough to look and see if dns isn't nuts.

the problem is regular expressions just suck at
cidrs.  so i wrote contrib quanstro/cidr.  here's
an example which uses the slightly strange -r flag
which reverses the meaning of pattern and file
(and changes | to &).

gcidr = (
        # only blocks that can map to google's a records
        72.14.192.0/18
        74.125.0.0/16
        209.85.128.0/17
        216.239.32.0/19
)

fn getips{
        ndb/dnsquery $* | sed 's/.*[    ]//g'
}

fn google{
        badgoogle=()
        if(! ip/cidr -rf <{getips google.com} <{echo $gcidr})
                badgoogle=1
        if(ip/cidr -f /lib/badcidr <{getips 9fans.net} )
                badgoogle=1
}

see http://www.quanstro.net/magic/man2html/1/cidr

- erik

Reply via email to