Thursday, April 11, 2013

DKIM Key 1024 2048 Bits Causes BIND NAMED Error

By default BIND can only handle 255 characters per line for record length, however it can handle values up to 65,536 characters.

The trick to getting a DKIM key (or any zone record for that matter) to wrap within this limit you do the following:
_domainKey.domain.com. IN  TXT ( "p=part of your key"
                                  "another part of your key"
                                  "last part of your key" )
By wrapping the entire value in brackets we keep it tied to one record and by quoting each line individually it allows us to surpass the line limit.

Common errors with this:
dns_rdata_fromtext: near eol: unbalanced quotes
dns_master_load: label too long
dns_master_load: syntax error
zone: loading master file: ran out of space