tungd / elixir-dns

DNS library for Elixir
BSD 3-Clause "New" or "Revised" License
114 stars 37 forks source link

Support for RR OPT records and arlist #32

Closed pzingg closed 4 years ago

pzingg commented 4 years ago

I wanted to be able to return "additional" records (contained in the arlist in the inet_dns "record" type).

This PR adds a new Elixir module, DNS.ResourceOpt (otherwise known as a "pseudo-RR" or "meta-RR" or "RR OPT"). Encoding and decoding resource lists will convert either to the standard DNS.Resource or DNS.ResourceOpt based on pattern matching.

Also, DNS.Record._to_record will now encode the additional records (if any) from the arlist when sending data in the response.