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.
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.