You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.7 KiB

  1. # -*- ispell-local-dictionary: "english" -*-
  2. #+TITLE: Bind v9 Domain name server
  3. * Usage
  4. ** Example =compose.yml=
  5. #+begin_src yaml
  6. dns:
  7. charm: bind
  8. options:
  9. vars:
  10. ## these vars are a facility to allow using `$var` in domain defs
  11. myip: 1.2.3.4
  12. zones:
  13. ## __all__ will be applied to all domains defined here
  14. __all__:
  15. ns:
  16. ## '_' is translated to '@' in BIND v9 zone definition, which in
  17. ## in turn refers to the current domain being defined.
  18. _: (dns.mycompany.com,sdns1.ovh.net,ns6.gandi.net)
  19. mx:
  20. _: (1 ,(5 alt(1,2),10 alt(3,4)).)aspmx.l.google.com.
  21. mycompany.com:
  22. mx:
  23. news: 10 news
  24. ## Names will generate IN A/CNAME depending if an IP is detected or a name
  25. name:
  26. ## key and values can be expanded, the syntax uses the same logic
  27. ## than shell expansion with `{`, `}` and `,`. So this:
  28. ## `(_,dns,core(,-01))` will demux to `_ dns core core-01`, so all
  29. ## these keys will receive the following value.
  30. (_,dns,core(,-01)): $myip
  31. core-02: 4.5.6.7
  32. ## You can specify after a space, a TTL that will be applied to all
  33. ## definitions inside the section:
  34. name 3h:
  35. ## `www` required not to be an IP by zonecheck
  36. (www,admin,smtp,beta,alpha,erp(,-beta)): core-01
  37. news: 77.32.131.26
  38. r.news: r.mailin.fr.
  39. img.news: img.mailin.fr.
  40. spf 3h:
  41. ## Remember that this is YAML that also offer nice syntaxic
  42. ## feature to avoid repeating values.
  43. _: &spf >-
  44. v=spf1 a
  45. a:smtp.free.fr
  46. a:smtp.mycompany.com
  47. include:spf.sendinblue.com
  48. mx ?all
  49. txt 3h:
  50. _:
  51. - *spf
  52. - Sendinblue-code:xxx
  53. - google-site-verification=yyy
  54. news: "v=spf1 include:spf.sendinblue.com mx ~all"
  55. mail._domainkey(,.news):
  56. "k=rsa;p=zzz"
  57. _dmarc.news: >-
  58. v=DMARC1;
  59. p=none;
  60. sp=none;
  61. rua=mailto:dmarc@mailinblue.com!10m;
  62. ruf=mailto:dmarc@mailinblue.com!10m;
  63. rf=afrf;
  64. pct=100;
  65. ri=86400
  66. (othercompany.com,other-company.com):
  67. name:
  68. (_,www,mail): $myip
  69. (admin,beta): www
  70. #+end_src
  71. * Persistence
  72. backup will keep:
  73. - /etc/bind/rndc.key
  74. - /etc/bind/.db.$DOMAIN files keeping a hash of the configuration along
  75. with the given serial that matches the zone file. This is to be sure to
  76. advertise the same serial after a recovery.