Are there any libs to work with DNS wire format ? I found this lib for erlang not sure how to work with this though
anyone experienced with the format got some questions, working on a side project
I have this code where I can read the incoming application/dns-message
body of the request
echo -n 'q80BAAABAAAAAAAAA3d3dwdleGFtcGxlA2NvbQAAAQAB' | base64 | curl -H 'content-type: application/dns-message' --data-binary @- https://cloudflare-dns.com/dns-query -o -
post "/" do
{:ok, body, conn} = Plug.Conn.read_body(conn)
{:ok, query} = String.trim(body) |> Base.url_decode64(padding: false)
IO.inspect(query, label: "Query")
conn
|> put_resp_content_type("application/dns-message")
|> send_resp(
200,
Jason.encode!(%{
msg: "I don't have a heart but I am alive!"
})
)
end
i am trying to work this out https://developers.cloudflare.com/1.1.1.1/dns-over-https/wireformat
Not sure how to make a request to the upstream DNS from wireformat and return a response I am using GitHub - tungd/elixir-dns: DNS library for Elixir to do the JSON format. Need to know how to get the wireformat to standard domain to send using elixir-dns and then convert the response back to wireformat