how to obtain MX records for a domain

Stefan Puiu stefan.puiu at gmail.com
Wed Jul 13 06:49:55 UTC 2005


Well,=20

in the queryNameServers() function you have the actual query code,
just find the line where the query is made (the res_mkquery() call)
and replace ns_t_soa with ns_t_mx. Some of the checks relevant for SOA
don't make sense for MX records, like making sure you get only one
record.

On 7/9/05, frank at nfurter.spam <frank at nfurter.spam> wrote:
> I have looked through every page of the DNS+BIND book, particularly
> the chapter on resolver programming Ch 15, and I cannot find any
> example to obtain MX records for a domain. Ch 15 gives as an example
> getting SOA records or some such, which appears irrelevant.
>=20
> It would be very convenient to have a short example to do this.... can
> you tell me if I am wrong, or if there is an example in some other
> source?



More information about the bind-users mailing list