tungd / elixir-dns

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

Encoding some resources myself? #57

Open bortzmeyer opened 1 year ago

bortzmeyer commented 1 year ago

I would like to return resource records whose types are not encoded by the Erlang library (such as LOC). I can do the encoding myself but I don't know how to put this in a DNS.Resource. If I send a binary, DNS.Resource.to_record complains. What is the proper way to do so and is it even possible?

bortzmeyer commented 1 year ago

Got it (from the Erlang sources), you just have to use a number (the type of the resource record) and not an atom in the type field of a %DNS.Resource. Then you can supply what you want in the data field. This deserves documentation.