Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QDnsLookup : suspiciously high failure rate

    General and Desktop
    4
    8
    374
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      gervay last edited by

      Hello people,

      I'm basically trying to benchmark a bunch of dns servers through QDnsLookup. The thing is that for some reasons the error "Invalid reply received" appears far too often and I suspect that overlooked something.

      Here is an overview of my code :

      foreach (OpennicParser::DnsServer dns, mDnsList) {
          Score currentScore = Score();
          currentScore.dns = dns;
      
          this->setNameserver(dns.ipv4);
          currentScore.totalTime.start();
      
          foreach (QString domain, mDomainsList) {
              this->setName(domain);
              this->lookup();
              this->mLoop.exec();
      
              if (this->error()) {
                  currentScore.errorEncountered = true;
                  break;
               }
          }
      
          currentScore.totalTime = currentScore.totalTime.addSecs(currentScore.totalTime.elapsed());
          mScoresList += currentScore
      }
      

      This has been initialized in the constructor of my class, class that inherits from QDnsLookup :

      mDnsList = dnsList;
      mDomainsList = domainsList;
      
      this->setType(QDnsLookup::ANY);
      connect(this, &Benchmarker::finished, &this->mLoop, &QEventLoop::quit);
      

      and nearly half of the interrogated servers fails to respond properly. I know that behind the scene systemd-resolved is used by QDnsLookup but thats all I really know. I tried to adapt my QDnsLookup::Type but at the end of the day it didnt change anything. I always got this high failure rate :/ and this happens kinda randomly. Sometime even 1.1.1.1 or 8.8.8.8 fails the benchmark because of such weird event :/

      Any idea ?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        What version of Qt ?
        Running on what OS ?
        How fast are you doing these requests ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        G 1 Reply Last reply Reply Quote 0
        • Kent-Dorfman
          Kent-Dorfman last edited by

          when you say you are benchmarking DNS servers that would make me nervous if they were my DNS servers. Are you sure you're not being denied access to the servers because you are hitting them at too high a frequency? Remember we live in the world of denial of service attacks and many benchmarking tools look like a DOS attack to the recipient.

          1 Reply Last reply Reply Quote 4
          • G
            gervay @SGaist last edited by

            @sgaist well im using Qt-Creator 4.9.1 with Qt 5.12.3. All of this is running on KDE Neon 20190815.

            @Kent-Dorfman it's crazy I didn't think of this sooner 0: however it's the first request to one of those servers that generally raises an error. Right now I've been asking those servers to resolve 25 domains. Basic domains like google.com, stackoverflow.com, etc. and as soon as its trying to resolve the first domain, it fails :/

            In my case the first domain to be requested is google.com. Even if I change it to something else, it doesnt change this failure rate :/

            In the meanwhile im gonna add some kind of pause in between the requests. Maybe its gonna change the results.

            1 Reply Last reply Reply Quote 0
            • G
              gervay last edited by

              Any suggestion ?

              1 Reply Last reply Reply Quote 0
              • mrjj
                mrjj Lifetime Qt Champion last edited by

                Hi
                did pausing make any differnce?

                G 1 Reply Last reply Reply Quote 0
                • G
                  gervay @mrjj last edited by

                  @mrjj yupp. On a total from 83 servers nearly 50 of them failed, even though I had setup a 200ms pause between every requests :/ Even 8.8.8.8 and 1.1.1.1.

                  1 Reply Last reply Reply Quote 0
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    As @Kent-Dorfman already wrote, it's not unlikely that you get denied. Running stress test against servers without any form of agreement will likely be seen as a DOS attempt.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post