private async Task <IDictionary <string, string> > ResolvePtrTopClientsAsync(List <KeyValuePair <string, int> > topClients)
        {
            IDictionary <string, string> dhcpClientIpMap = _dnsWebService.DhcpServer.GetAddressHostNameMap();

            async Task <KeyValuePair <string, string> > ResolvePtrAsync(string ip)
            {
                if (dhcpClientIpMap.TryGetValue(ip, out string dhcpDomain))
                {
                    return(new KeyValuePair <string, string>(ip, dhcpDomain));
                }

                IPAddress address = IPAddress.Parse(ip);

                if (IPAddress.IsLoopback(address))
                {
                    return(new KeyValuePair <string, string>(ip, "localhost"));
                }

                DnsDatagram ptrResponse = await _dnsWebService.DnsServer.DirectQueryAsync(new DnsQuestionRecord(address, DnsClass.IN), 500);

                if (ptrResponse.Answer.Count > 0)
                {
                    IReadOnlyList <string> ptrDomains = DnsClient.ParseResponsePTR(ptrResponse);
                    if (ptrDomains.Count > 0)
                    {
                        return(new KeyValuePair <string, string>(ip, ptrDomains[0]));
                    }
                }

                return(new KeyValuePair <string, string>(ip, null));
            }

            List <Task <KeyValuePair <string, string> > > resolverTasks = new List <Task <KeyValuePair <string, string> > >();

            foreach (KeyValuePair <string, int> item in topClients)
            {
                resolverTasks.Add(ResolvePtrAsync(item.Key));
            }

            Dictionary <string, string> result = new Dictionary <string, string>();

            foreach (Task <KeyValuePair <string, string> > resolverTask in resolverTasks)
            {
                try
                {
                    KeyValuePair <string, string> ptrResult = await resolverTask;
                    result[ptrResult.Key] = ptrResult.Value;
                }
                catch
                { }
            }

            return(result);
        }