No subject

Adam Aquilon <>
Wed May 19 12:21:31 CEST 2004


Hello all,

Short version:

What is the "least bad" way of using the undocumented
functions for querying DNS servers found in the 'inet_res'
(and related) modules? 

Specifically, I want to retrieve MX records from a DNS server.


Background:

When looking for a way of getting hold of mail server
host names for sending emails from Erlang, I found the
DNS-related code in the inet modules. They aren't
documented, so I assume they really should be left alone.
They are used for the gethostbyname and other similar
functions, but they also seem to be written to handle
queries of different types as well.

Is there any special reason why some of these functions
could not be exposed to the "general public" (i.e. me!)?

For example: the function inet_res:nslookup/3 seems to 
be something very close to what I need:

erl>  inet_res:nslookup("mail.domain.name",1,mx).

The above call returns {ok,#dns_rec{}} which seems to
contain the MX records I was looking for.

Hoping for some enlightenment,
Adam Aquilon






More information about the erlang-questions mailing list