private static MailExchange ReadMailExchange(BinaryReader reader) { MailExchange mailExchange = new MailExchange(); mailExchange.Preference = ReadUInt16BE(reader); mailExchange.HostName = ReadDomainName(reader); return(mailExchange); }
private static string[] GetMailExchangeAliases(string domainName, DnsMessage answer) { List <string> aliases = new List <string>(); foreach (DnsResource resource in answer.Answers) { if (resource.QueryType == QueryType.MailExchange && resource.Name == domainName) { MailExchange mailExchange = (MailExchange)resource.Content; aliases.Add(mailExchange.HostName); } } return(aliases.ToArray()); }