Exemplo n.º 1
0
 public LookupClientWrapper(DomainParser domainParser, ILogService logService, ILookupClient lookupClient, LookupClientWrapper @default)
 {
     LookupClient          = lookupClient;
     lookupClient.UseCache = false;
     _log          = logService;
     _domainParser = domainParser;
     _default      = @default;
 }
Exemplo n.º 2
0
 private IDnsQueryResponse RecursivelyFollowCnames(IDnsQueryResponse result)
 {
     if (result.Answers.CnameRecords().Any())
     {
         var cname     = result.Answers.CnameRecords().First();
         var nsChecker = this;
         if (_default != null)
         {
             nsChecker = _default;
         }
         var nameServerIpAddresses     = nsChecker.GetNameServerIpAddresses(cname.CanonicalName);
         var recursiveClient           = new LookupClientWrapper(_domainParser, _log, new LookupClient(nameServerIpAddresses.ToArray()), _default);
         IDnsQueryResponse txtResponse = recursiveClient.LookupClient.Query(cname.CanonicalName, QueryType.TXT);
         _log.Debug("Name server {NameServerIpAddress} selected", txtResponse.NameServer.Endpoint.Address.ToString());
         return(recursiveClient.RecursivelyFollowCnames(txtResponse));
     }
     return(result);
 }