Search Tools Links Login

MX Query

This code looks up MX (Mail eXchange) records for any domain from a DNS server (For those who dont know what a MX record is, MX records contain the name of the SMTP server which receives mail for a domain).
This is an improvement (I hope so :) over Jason Martin's code ( Here are the changes I made:
1. It uses winsock and not API for the query.
2. It wont freeze if you give a non-existent domain or DNS server.
3. It gets the DNS server in use by your computer by network api instead of registry.
4. There was a bug in Jason's code due to which if the DNS response was compressed it would return only the first MX record. For example, Jason's code would return one MX record for while mine will return all five.
I'll appreciate any feedback on this code.

Original Author: Saurabh Gupta


The MX records of a domain.

API Declarations

A few in the code.

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 75 times


Visual Basic 6

Posted: 9/3/2020 3:45:00 PM
Size: 27,367 bytes

Loading Comments ...


No comments have been added for this post.

You must be logged in to make a comment.