Resolving MX records

Jean-Christophe Smith jsmith at publichost.com
Wed Jan 2 23:31:26 UTC 2002


The format for the datagrams is in rfc1035(some helpful concepts in rfc1034
too), but manufacturing the dns queries by hand is a pain. Look for a dns
resolver library for java I'm sure there are a few. Don't do it at the
socket level, there are so many combinations of data that you could be
returned from the DNS server, like MX records pointing to CNAMES that are
pointing to other CNAMES, etc.. There could also be compression or
truncating going on that you would have to handle. A good resolver library
will do this decoding for you.

Hopefully you are not planning to run this from a browser applet, because
the java security model will not let you establish IP connections with
servers other than the one you loaded the applet from.

Does the java.net.* libs not have a few resolver methods?

Jean-Christophe Smith
Senior Software Engineer
VitalStream

----- Original Message -----
From: "webs-uk.com" <webs-uk at breathemail.net>
Newsgroups: comp.protocols.dns.bind
To: <comp-protocols-dns-bind at moderators.isc.org>
Sent: Wednesday, January 02, 2002 1:26 PM
Subject: Resolving MX records


> Hi,
>
> I am trying to write an email sender in Java. I have worked out that I
need
> to get the MX info for the destination so that I can conect to the SMTP
> server.
>
> I have looked at several RFCs such as RFC883. and others and have worked
out
> that I can send a datagramme to a DNS to query it for the MXinfo.
>
> The RFC papers are not easy to read and I have not been able to work out
how
> to format the datagramme properly.
>
> Have you seen any books that cover this in sufficient detail? would you
> recommend any books? Does anyone have an example in C, C++  or java of the
> code I need to use?
>
> Your help would be most appreciated and I will credit any code contributed
> to tis project.
>
> If you can point me in the right direction, (i am going nuts trying to
work
> this out) then please feel free to contact me at n.y.bisby at breathemail.net
>
> Thanks
>
> Neil Bisby
>
>
>



More information about the bind-users mailing list