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 (http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=11006&lngWId=1). Here are the changes I made:
-
It uses winsock and not API for the query.
-
It wont freeze if you give a non-existent domain or DNS server.
-
It gets the DNS server in use by your computer by network api instead of registry.
-
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 earthlink.com while mine will return all five.
I'll appreciate any feedback on this code.
The MX records of a domain.
Submitted On | 2002-04-22 04:47:40 |
By | Saurabh Gupta |
Level | Intermediate |
User Rating | 4.4 (66 globes from 15 users) |
Compatibility | VB 5.0, VB 6.0 |
Category | Internet/ HTML |
World | Visual Basic |
Archive File | MX_Query743404212002.zip |
A few in the code.