Пример #1
0
        private static MailExchange ReadMailExchange(BinaryReader reader)
        {
            MailExchange mailExchange = new MailExchange();

            mailExchange.Preference = ReadUInt16BE(reader);
            mailExchange.HostName   = ReadDomainName(reader);
            return(mailExchange);
        }
Пример #2
0
        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());
        }