[rbldnsd] AAAA Queries?
Steven F Siirila
sfs at tc.umn.edu
Fri Jul 28 21:54:24 MSD 2006
On Fri, Jul 28, 2006 at 01:49:05PM -0400, Victor Duchovni wrote:
> On Fri, Jul 28, 2006 at 12:41:33PM -0500, Steven F Siirila wrote:
>
> > We are currently using this snippet to query DNSbls.
> > We do not yet run IPv6 though, so it shouldn't be an issue anyways.
> >
> > #define UC(b) (((int)b) & 0xff) /* converts char to int (0-255) */
> >
> > /*
> > * dnsbl - read DNS block list data
> > */
> > struct hostent *
> > dnsbl(char *domain, in_addr_t ipaddr)
> > {
> > char *cp; /* general purpose */
> > char hbuf[MAXHOSTNAMELEN]; /* temporary host name buffer */
> > struct hostent *hp; /* host node pointer */
> >
> > cp = (char *)&ipaddr;
> > sprintf(hbuf, "%d.%d.%d.%d.%s",
> > UC(cp[3]), UC(cp[2]), UC(cp[1]), UC(cp[0]), domain);
> > if (debug) {
> > errmsg("Querying %s", hbuf);
> > }
> > if ((hp = gethostbyname(hbuf)) == NULL && h_errno == TRY_AGAIN) {
> > errmsg("Temporary error querying %s", domain);
> > }
> > return(hp);
> > }
>
> This code is wrong, it will make queries for "IP.RBL.<parent_domain>" for
> each domain on your search list. It will on IPv6 capable systems make
> "AAAA" queries, ... It is not capable of reading the corresponding TXT
> record. Rewrite using res_init(3), res_search(3), ...
Granted, it is not ideal. It should probably be changed. But until there
is a real need to, it's not going to happen due to other time commitments.
We don't use TXT records either, we write a custom 550 5.7.1 message with
a URL containing encrypted data, allowing the sender to initiate a three-
way handshake process, etc...
Thanks for the tips! BTW, I'm an old-timer when it comes to C coding (1991).
P.S. I hate HTML-only e-mail with a passion as well. :)
--
Steven F. Siirila Office: Lind Hall, Room 130B
Internet Services E-mail: sfs at umn.edu
Office of Information Technology Voice: (612) 626-0244
University of Minnesota Fax: (612) 626-7593
More information about the rbldnsd
mailing list