Aug 142009

Here we go again 🙂 for using ipv6 dnsbl, we need postfix version => 2.6 as the author of postfix state in postfix-users list. This site is a good reference on how to build postfix RPM under redhat based system

How ipv6 dnsbl keep AAAA record in their zone? this is how it done. for example we got ipv6:


(this one of my workstation ipv6 address 🙂 )

RBL query lookup would be like this:

$ dig aaaa 6.1.e.e.a.e.e.f.f.f.1.d.
$ dig txt 6.1.e.e.a.e.e.f.f.f.1.d.

So, we need configure our private BIND9 RBL like this: first create dnsbl.domain.tld zone in /etc/named.conf

zone "dnsbl.domain.tld" {
      type master;
      file "dnsbl.domain.tld";

second, we have to create dnsbl.domain.tld zone file.

$TTL 86400
@       IN      SOA     ns1.dnsbl.domain.tld.     hostmaster.dnsbl.domain.tld. (
                        2009071228      ; serial number YYMMDDNN
                        28800           ; Refresh
                        7200            ; Retry
                        864000          ; Expire
                        86400           ; Min TTL
                NS      ns1.dnsbl.domain.tld.
                NS      ns2.dnsbl.domain.tld.
$ORIGIN dnsbl.domain.tld.
blackhole       IN      A
                IN      AAAA    ::2
                IN      TXT     "Blocked by dnsbl.domain.tld for SPAM Sources"
1.3.0.c.a.         IN      CNAME   blackhole
e.c.a.f.e.b.a.b.         IN      CNAME   blackhole
6.1.e.e.a.e.e.f.f.f.1.d.         IN      CNAME   blackhole

why do i using CNAME instead of direct AAAA record? it’s just for efficiency, to avoid repetitions when adding ipv6 address on the blacklist. beside, postfix resolver can follow CNAME until found AAAA and TXT record. IN postfix configuration, add this line:

smtpd_recipient_restrictions =
        reject_rbl_client dnsbl.domain.tld,

don’t forget to exclude 2001:470:19:13c:219:d1ff:feea:ee16 from mynetworks

mynetworks = ![2001:470:19:13c:219:d1ff:feea:ee16], .....

now test all the things we’ve configured.

$ telnet mx.domain.tld 25
220 mx.domain.tld ESMTP Postfix (2.6.1)
ehlo wks.domain.tld
250-SIZE 52428800
250 DSN
mail from:
250 2.1.0 Ok
rcpt to:
554 5.7.1 Service unavailable; Client host [2001:470:19:13c:219:d1ff:feea:ee16] blocked using dnsbl.domain.tld;
Blocked by dnsbl.domain.tld for SPAM Sources
221 2.0.0 Bye

Connection to host lost.

In Postfix log, we will see rejection like this:

Aug 14 08:56:16 fire postfix/qmgr[3237]: D10B1262DBB: removed
Aug 14 08:56:19 fire postfix/smtpd[3239]: NOQUEUE: reject: RCPT from wks.domain.tld[2001:470:19:13c:219:d1ff:feea:ee16]: 554 5.7.1 Service unavailable; Client host [2001:470:19:13c:219:d1ff:feea:ee16] blocked using dnsbl.domain.tld; Blocked by dnsbl.domain.tld for SPAM Sources; from= to= proto=ESMTP helo=

that’s all 🙂

  2 Responses to “Postfix IPv6 + RBL + BIND9 as DNSBL”

Comments (2)
  1. test

  2. Great!

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>