I wrote an MxResolver.cs class that queries a DNS Name Server using System.Net.Sockets.UdpClient on Port 53.