tungd / elixir-dns

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

A separate code for NODATA #29

Open bortzmeyer opened 5 years ago

bortzmeyer commented 5 years ago

Today, when the domain name does not exist, DNS.resolve() returns {:error, :not_found}. But it also returns the same when the name exists, but does not have the required type (DNS.resolve("github.com", :aaaa), for instance).

At the very least, this calls for two separate codes (something like {:error, :no_data} but I would prefer {:ok, :no_data}since it is not an error).

The only workaround seems to be using DNS.query(), which is at a lower level.

tungd commented 5 years ago

Sounds very reasonable to me, will get it done by the weekend. Thanks