// Copyright (c) 2010 Martin Knafve / hMailServer.com. // http://www.hmailserver.com #pragma once namespace HM { class HostNameAndIpAddress; class DNSRecord; class DNSResolver { private: public: DNSResolver(); virtual ~DNSResolver(); bool GetEmailServers(const String &sDomainName, std::vector &saFoundNames); bool GetMXRecords(const String &sDomain, std::vector &vecFoundNames); bool GetIpAddresses(const String &sDomain, std::vector &saFoundNames, bool followCnameRecords); bool GetTXTRecords(const String &sDomain, std::vector &foundResult); bool GetPTRRecords(const String &sIP, std::vector &vecFoundNames); private: bool GetEmailServersRecursive_(const String &sDomainName, std::vector &saFoundNames, int recursionLevel); bool GetIpAddressesRecursive_(const String &hostName, std::vector &addresses, int recursionLevel, bool followCnameRecords); bool GetTXTRecordsRecursive_(const String &sDomain, std::vector &foundResult, int recursionLevel); bool GetMXRecordsRecursive_(const String &sDomain, std::vector &vecFoundNames, int recursionLevel); std::vector GetDnsRecordsValues_(std::vector records); }; }