inkblot/puppet-bind

How to create an MX or NS record?

schirmacher opened this issue · 3 comments

I can't figure out how to define an MX or NS record. This is probably not a bug but an example would be helpful.

I tried
dns_rr { 'IN/MX/mx.example.org': rrdata => [ '10', ], }
and
dns_rr { 'IN/MX': rrdata => [ '10 mx.example.org', ], }
which failed both.

I think I understand what the difficulty is, which is how to specify a dns_rr resource for a record at the origin of a zone. If these don't work, it's probably a bug:

dns_rr { 'IN/MX/example.org': rrdata => [ '10 mx.example.org.', ], }

or

dns_rr { 'IN/MX/example.org': rrdata => [ '10 mx', ], }

Could you please try this and let me know whether it solves the issue?

yes, I can create a single NS or MX record this way. However I can't define more than one MX record - which is what many users need:

dns_rr { 'IN/MX/example.org': rrdata => [ '10 mx1.example.org.', ], }
dns_rr { 'IN/MX/example.org': rrdata => [ '20 mx2.example.org.', ], }

The resulting error is:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Dns_rr[IN/MX/example.org] is already declared in file 
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Multiple records would work like this:

dns_rr { 'IN/MX/example.org': rrdata => [ '10 mx1', '20 mx2' ], }

I'm glad this works. I'll write up some examples for the README.