Important: Please read the Qt Code of Conduct -

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;
        foreach (QString domain, mDomainsList) {
            if (this->error()) {
                currentScore.errorEncountered = true;
        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;
    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 or 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,, etc. and as soon as its trying to resolve the first domain, it fails :/

    In my case the first domain to be requested is 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

    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 and

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

Log in to reply