Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDnsLookup : suspiciously high failure rate
QtWS25 Last Chance

QDnsLookup : suspiciously high failure rate

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 4 Posters 782 Views
  • 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 Offline
    G Offline
    gervay
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0
      • Kent-DorfmanK Offline
        Kent-DorfmanK Offline
        Kent-Dorfman
        wrote on last edited by
        #3

        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
        4
        • SGaistS SGaist

          Hi and welcome to devnet,

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

          G Offline
          G Offline
          gervay
          wrote on last edited by
          #4

          @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
          0
          • G Offline
            G Offline
            gervay
            wrote on last edited by
            #5

            Any suggestion ?

            1 Reply Last reply
            0
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi
              did pausing make any differnce?

              G 1 Reply Last reply
              0
              • mrjjM mrjj

                Hi
                did pausing make any differnce?

                G Offline
                G Offline
                gervay
                wrote on last edited by
                #7

                @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
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  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
                  1

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved