QDnsLookup : suspiciously high failure rate



  • 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 ?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

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



  • 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.



  • @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.



  • Any suggestion ?


  • Lifetime Qt Champion

    Hi
    did pausing make any differnce?



  • @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.


  • Lifetime Qt Champion

    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.


 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.