Friday, November 30, 2012

Adding new DNS record types to PowerDNS software

Our friends from NLNetLabs recently described how to add new record types to NSD, which I think is a great idea. Especially if this enables the community to add their favorite record types for us!

Here are the full descriptions on how we added the TLSA record type to all PowerDNS products, with links to the actual source code.

First, define the TLSARecordContent class in dnsrecords.hh:

class TLSARecordContent : public DNSRecordContent
  uint8_t d_certusage, d_selector, d_matchtype;
  string d_cert;
The 'includeboilerplate(TLSA)' generates the four methods that do everything PowerDNS would ever want to do with a record:
  • read TLSA records from zonefile format
  • write out a TLSA record in zonefile format
  • read a TLSA record from a packet
  • write a TLSA record to a packet
boilerplate_conv(TLSA, 52,
                 conv.xfrHexBlob(d_cert, true);
This code defines the TLSA rrtype number as 52. Secondly, it says there are 3 eight bit fields for Certificate Usage, Selector and Match type. Next, it defines that the rest of the record is the actual certificate (hash). 'conv' methods are supplied for all DNS data types in use.

Now add TLSRecordContent::report() to reportOtherTypes().

And that's it. For completeness, add TLSA and 52 to the QType enum in qtype.hh, which makes it easier to refer to the TLSA record in code if so required.

Please contact us to get your patch merged, or submit it via our GitHub page!


  1. This comment has been removed by the author.

  2. This tool is using in a very sincere manner to record Office IP's....

  3. That's tool is using in a very sincere manner to record Office IP, thanks for share it.
    Crack Software Download

  4. Hanbridge has adopted a structured and interactive educational approach to enable you to learn Mandarin effectively and reach your targeted proficiency level. Clear pronunciation, the proper use of tones, real-life topics, and bilingual instruction all combine to ensure you will be able to communicate effectively.

    More Chinese learning tags : how to learn Chinese | learn to speak Chinese | mandarin Chinese

  5. Thanks for sharing..!! I love your post .. I am looking more post like this one on this blog .. this post proves really helpful for me .
    Full Software

  6. This web site is really a walk-through for all of the info you wanted about this and didn’t know who to ask.
    crack software | vipre antivirus free download full version with key

  7. oh wow!! this is really nice, such a nice piece of work........
    chris pc ram booster serial key