[Pdns-users] Re: SPF records support -- fixed! [PATCH]

Julian Mehnle julian at mehnle.net
Thu Jun 22 21:40:06 UTC 2006

Julian Mehnle wrote:
> Several months ago, Bert Hubert wrote:
> > I've just added SPF records support. I don't personally have the
> > knowledge to test if they work, so if you care about SPF records,
> > please test the latest version from subversion, see
> > http://wiki.powerdns.com
> >
> > If you can't get that to work, but do want to test SPF, please contact
> > me and I'll help.
> Today I added a record to one of my zones with type='SPF' and content=
> 'v=spf1 ...' and then tried to query it using `dig <domain> TYPE99`, but
> got no records back.  (Querying a type='TXT' record in the same domain
> works ok.)
> However, I get the following error in syslog whenever I do a TYPE99 or
> ANY query on the domain:
> | pdns[<pid>]: Unable to insert a record of type #0 for '<domain>'
> When I change the type='SPF' record to type='FOO', I get exactly the
> same results.  This, and reading PDNS source changeset 472[1], leads me
> to believe that type='SPF' isn't actually recognized.
> [...]
> References:
>  1. http://wiki.powerdns.com/projects/trac/changeset/472

Today I grew tired of waiting and tried fixing the issue myself.  Out of 
pure speculation, I made the following modification:

--- pdns-2.9.20.org/pdns/qtype.cc  2006-06-22 20:05:32.000000000 +0000
+++ pdns-2.9.20/pdns/qtype.cc      2006-06-22 20:08:20.000000000 +0000
@@ -56,6 +56,7 @@
+      insert("SPF",99);

Lo and behold, the problem was solved!  With this patch PDNS can now 
successfully serve the SPF RR type (even though dig doesn't really support 
it yet, but BIND 9.4 and the included dig will):

| $ dig home6.mehnle.net TXT +sho
| "v=spf1 mx mx:mehnle.net -all"
| $ dig home6.mehnle.net TYPE99 +sho
| \# 29 1C763D73706631206D78206D783A6D65686E6C652E6E6574202D616C 6C

I'm attaching the patch as a proper file, too.  I hope this gets merged 
into the next PDNS release.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdns-2.9.20-spf-rrtype-fix.patch
Type: text/x-diff
Size: 334 bytes
Desc: not available
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20060622/7fabb9aa/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20060622/7fabb9aa/attachment.sig>

More information about the Pdns-users mailing list