2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 Jeremy Lainé <jeremy.laine@m4x.org>
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2012-01-23 17:25:39 +00:00
|
|
|
|
2014-03-11 08:35:35 +00:00
|
|
|
#include <QDnsLookup>
|
|
|
|
#include <QHostAddress>
|
2012-01-23 17:25:39 +00:00
|
|
|
|
2014-03-11 08:35:35 +00:00
|
|
|
//! [0]
|
|
|
|
|
|
|
|
struct DnsQuery
|
|
|
|
{
|
|
|
|
DnsQuery() : type(QDnsLookup::A) {}
|
|
|
|
|
|
|
|
QDnsLookup::Type type;
|
|
|
|
QHostAddress nameServer;
|
|
|
|
QString name;
|
|
|
|
};
|
|
|
|
|
|
|
|
//! [0]
|
2012-01-23 17:25:39 +00:00
|
|
|
|
|
|
|
class DnsManager : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
DnsManager();
|
2014-03-11 08:35:35 +00:00
|
|
|
void setQuery(const DnsQuery &q) { query = q; }
|
2012-01-23 17:25:39 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void execute();
|
|
|
|
void showResults();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QDnsLookup *dns;
|
2014-03-11 08:35:35 +00:00
|
|
|
DnsQuery query;
|
2012-01-23 17:25:39 +00:00
|
|
|
};
|
|
|
|
|