Thursday, June 7, 2007

Configuring your DNS server for inet_res.

When using inet_res, you must configure a DNS server to query, this could be done like this:

-define(MASTER_DNS, {212,XX,XX,252}).

init() ->

Once you've called your ?MODULE:init/1 you're able to use your ?MODULE:get_mx/1 function.

node> mail:init().

node> mail:get_mx("").

The result is a list of tuples, the first element is the server weight, the second the server name :p

No comments: