9

I installed dkim. Now when I setup dns, I have a syntax error

This is dns for dkim:

201704._domainkey.example.com       IN      TXT     "v=DKIM1; h=rsa-sha256; k=rsa; s=email; p=blah blah;"

root@example:~# named-checkzone example.com /etc/bind/db.example.com dns_rdata_fromtext: /etc/bind/db.example.com:35: syntax error zone example.com/IN: loading from master file /etc/bind/db.example.com failed: syntax error zone example.com/IN: not loaded due to errors.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
pedro
  • 447
  • 4
  • 15

1 Answers1

18

Not sure on the cause, but splitting the long string up into shorter ones separated by spaces and wrapped by ( and ) fixes the issue. For example,

dkim3._domainkey IN TXT ("v=DKIM1; t=s; p=" "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD78Ki2d0zmOlmjYNDC7eLG3af12KrjmPDeYRr3" "q9MGquKRkRFlY+Alq4vMxnp5pZ7lDaAXXwLYjN91YY7ARbCEpqapA9Asl854BCHMA7L+nvk9kgC0" "ovLlGvg+hhqIPqwLNI97VSRedE60eS+CwcShamHTMOXalq2pOUw7anuenQIDAQAB")

pedro
  • 447
  • 4
  • 15
  • 1
    Thanks :) (have issue on debian) found this : https://support.plesk.com/hc/en-us/articles/115002551549-Unable-to-start-BIND-named-dns-rdata-fromtext-syntax-error- – Denis Chenu Sep 07 '18 at 15:55
  • 3
    ive heard that the reason is the value has a 256 character limit, so splitting it up on multiple lines seems fix that. – Directory Dec 03 '20 at 20:20