public IHttpActionResult GetHostNameByIP(string ipAddress) { IDnsQueryResponse result = null; RecordDto hostName = new RecordDto() { IPAddress = ipAddress }; result = _client.QueryReverse(IPAddress.Parse(ipAddress)); hostName.HostName = result.Answers.PtrRecords().Select(name => name.PtrDomainName.ToString()); return(Ok(hostName)); }