Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QDnsLookup Class Reference

The QDnsLookup class represents a DNS lookup. More...

#include <qdnslookup.h>

Inheritance diagram for QDnsLookup:
Collaboration diagram for QDnsLookup:

Public Types

enum  Error {
  NoError = 0 , ResolverError , OperationCancelledError , InvalidRequestError ,
  InvalidReplyError , ServerFailureError , ServerRefusedError , NotFoundError ,
  TimeoutError
}
 Indicates all possible error conditions found during the processing of the DNS lookup. More...
enum  Type {
  A = 1 , AAAA = 28 , ANY = 255 , CNAME = 5 ,
  MX = 15 , NS = 2 , PTR = 12 , SRV = 33 ,
  TLSA = 52 , TXT = 16
}
 Indicates the type of DNS lookup that was performed. More...
enum  Protocol : quint8 { Standard = 0 , DnsOverTls }
 Indicates the type of DNS server that is being queried. More...

Public Slots

void abort ()
 Aborts the DNS lookup operation.
void lookup ()
 Performs the DNS lookup.
Public Slots inherited from QObject
void deleteLater ()
 \threadsafe

Signals

void finished ()
 This signal is emitted when the reply has finished processing.
void nameChanged (const QString &name)
 This signal is emitted when the lookup \l name changes.
void typeChanged (QDnsLookup::Type type)
 This signal is emitted when the lookup \l type changes.
void nameserverChanged (const QHostAddress &nameserver)
void nameserverPortChanged (quint16 port)
void nameserverProtocolChanged (QDnsLookup::Protocol protocol)
Signals inherited from QObject
void destroyed (QObject *=nullptr)
 This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked.
void objectNameChanged (const QString &objectName, QPrivateSignal)
 This signal is emitted after the object's name has been changed.

Public Member Functions

 QDnsLookup (QObject *parent=nullptr)
 Constructs a QDnsLookup object and sets parent as the parent object.
 QDnsLookup (Type type, const QString &name, QObject *parent=nullptr)
 Constructs a QDnsLookup object for the given type and name and sets parent as the parent object.
 QDnsLookup (Type type, const QString &name, const QHostAddress &nameserver, QObject *parent=nullptr)
 QDnsLookup (Type type, const QString &name, const QHostAddress &nameserver, quint16 port, QObject *parent=nullptr)
 QDnsLookup (Type type, const QString &name, Protocol protocol, const QHostAddress &nameserver, quint16 port=0, QObject *parent=nullptr)
 ~QDnsLookup ()
 Destroys the QDnsLookup object.
bool isAuthenticData () const
Error error () const
QString errorString () const
bool isFinished () const
 Returns whether the reply has finished or was aborted.
QString name () const
void setName (const QString &name)
QBindable< QStringbindableName ()
Type type () const
void setType (QDnsLookup::Type)
QBindable< TypebindableType ()
QHostAddress nameserver () const
void setNameserver (const QHostAddress &nameserver)
QBindable< QHostAddressbindableNameserver ()
quint16 nameserverPort () const
void setNameserverPort (quint16 port)
QBindable< quint16bindableNameserverPort ()
Protocol nameserverProtocol () const
void setNameserverProtocol (Protocol protocol)
QBindable< ProtocolbindableNameserverProtocol ()
void setNameserver (Protocol protocol, const QHostAddress &nameserver, quint16 port=0)
void setNameserver (const QHostAddress &nameserver, quint16 port)
QList< QDnsDomainNameRecordcanonicalNameRecords () const
 Returns the list of canonical name records associated with this lookup.
QList< QDnsHostAddressRecordhostAddressRecords () const
 Returns the list of host address records associated with this lookup.
QList< QDnsMailExchangeRecordmailExchangeRecords () const
 Returns the list of mail exchange records associated with this lookup.
QList< QDnsDomainNameRecordnameServerRecords () const
 Returns the list of name server records associated with this lookup.
QList< QDnsDomainNameRecordpointerRecords () const
 Returns the list of pointer records associated with this lookup.
QList< QDnsServiceRecordserviceRecords () const
 Returns the list of service records associated with this lookup.
QList< QDnsTextRecordtextRecords () const
 Returns the list of text records associated with this lookup.
QList< QDnsTlsAssociationRecordtlsAssociationRecords () const
Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 Constructs an object with parent object parent.
virtual ~QObject ()
 Destroys the object, deleting all its child objects.
virtual bool event (QEvent *event)
 This virtual function receives events to an object and should return true if the event e was recognized and processed.
virtual bool eventFilter (QObject *watched, QEvent *event)
 Filters events if this object has been installed as an event filter for the watched object.
QString objectName () const
Q_WEAK_OVERLOAD void setObjectName (const QString &name)
 Sets the object's name to name.
void setObjectName (QAnyStringView name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
QBindable< QStringbindableObjectName ()
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false.
bool isWindowType () const
 Returns true if the object is a window; otherwise returns false.
bool isQuickItemType () const
 Returns true if the object is a QQuickItem; otherwise returns false.
bool isQmlObjectType () const
 Returns whether the object has been created by the QML engine or ownership has been explicitly set via QJSEngine::setObjectOwnership().
bool signalsBlocked () const noexcept
 Returns true if signals are blocked; otherwise returns false.
bool blockSignals (bool b) noexcept
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it).
QThreadthread () const
 Returns the thread in which the object lives.
bool moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)
 Changes the thread affinity for this object and its children and returns true on success.
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds.
int startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer)
void killTimer (int id)
 Kills the timer with timer identifier, id.
void killTimer (Qt::TimerId id)
template<typename T>
findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object.
template<typename T>
QList< T > findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
template<typename T>
findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T>
QList< T > findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
const QObjectListchildren () const
 Returns a list of child objects.
void setParent (QObject *parent)
 Makes the object a child of parent.
void installEventFilter (QObject *filterObj)
 Installs an event filter filterObj on this object.
void removeEventFilter (QObject *obj)
 Removes an event filter object obj from this object.
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
bool disconnect (const QObject *receiver, const char *member=nullptr) const
void dumpObjectTree () const
 Dumps a tree of children to the debug output.
void dumpObjectInfo () const
 Dumps information about signal connections, etc.
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value.
bool setProperty (const char *name, QVariant &&value)
QVariant property (const char *name) const
 Returns the value of the object's name property.
QList< QByteArraydynamicPropertyNames () const
QBindingStoragebindingStorage ()
const QBindingStoragebindingStorage () const
QObjectparent () const
 Returns a pointer to the parent object.
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.

Static Public Member Functions

static bool isProtocolSupported (Protocol protocol)
static Q_DECL_CONST_FUNCTION quint16 defaultPortForProtocol (Protocol protocol) noexcept
Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 \threadsafe
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
template<typename Func1, typename Func2>
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection)
template<typename Func1, typename Func2>
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot)
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 \threadsafe
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
static bool disconnect (const QMetaObject::Connection &)
 Disconnect a connection.
template<typename Func1, typename Func2>
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
template<typename Func1>
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)

Properties

Error error
 the type of error that occurred if the DNS lookup failed, or NoError.
bool authenticData
 whether the reply was authenticated by the resolver.
QString errorString
 a human-readable description of the error if the DNS lookup failed.
QString name
 the name to lookup.
Type type
 the type of DNS lookup.
QHostAddress nameserver
 the nameserver to use for DNS lookup.
quint16 nameserverPort
 the port number of nameserver to use for DNS lookup.
Protocol nameserverProtocol
 the protocol to use when sending the DNS query
Properties inherited from QObject
QString objectName
 the name of this object

Additional Inherited Members

Protected Member Functions inherited from QObject
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr.
int senderSignalIndex () const
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal.
bool isSignalConnected (const QMetaMethod &signal) const
virtual void timerEvent (QTimerEvent *event)
 This event handler can be reimplemented in a subclass to receive timer events for the object.
virtual void childEvent (QChildEvent *event)
 This event handler can be reimplemented in a subclass to receive child events.
virtual void customEvent (QEvent *event)
 This event handler can be reimplemented in a subclass to receive custom events.
virtual void connectNotify (const QMetaMethod &signal)
virtual void disconnectNotify (const QMetaMethod &signal)
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr

Detailed Description

The QDnsLookup class represents a DNS lookup.

Since
5.0

\inmodule QtNetwork

QDnsLookup uses the mechanisms provided by the operating system to perform DNS lookups. To perform a lookup you need to specify a \l name and \l type then invoke the \l{QDnsLookup::lookup()}{lookup()} slot. The \l{QDnsLookup::finished()}{finished()} signal will be emitted upon completion.

For example, you can determine which servers an XMPP chat client should connect to for a given domain with:

void MyObject::lookupServers()
{
// Create a DNS lookup.
dns = new QDnsLookup(this);
connect(dns, &QDnsLookup::finished, this, &MyObject::handleServers);
// Find the XMPP servers for gmail.com
dns->setType(QDnsLookup::SRV);
dns->setName("_xmpp-client._tcp.gmail.com");
dns->lookup();
}

Once the request finishes you can handle the results with:

void MyObject::handleServers()
{
// Check the lookup succeeded.
if (dns->error() != QDnsLookup::NoError) {
qWarning("DNS lookup failed");
dns->deleteLater();
return;
}
// Handle the results.
const auto records = dns->serviceRecords();
for (const QDnsServiceRecord &record : records) {
...
}
dns->deleteLater();
}
Note
If you simply want to find the IP address(es) associated with a host name, or the host name associated with an IP address you should use QHostInfo instead.

Definition at line 216 of file qdnslookup.h.

Member Enumeration Documentation

◆ Error

Indicates all possible error conditions found during the processing of the DNS lookup.

\value NoError no error condition.

\value ResolverError there was an error initializing the system's DNS resolver.

\value OperationCancelledError the lookup was aborted using the abort() method.

\value InvalidRequestError the requested DNS lookup was invalid.

\value InvalidReplyError the reply returned by the server was invalid.

\value ServerFailureError the server encountered an internal failure while processing the request (SERVFAIL).

\value ServerRefusedError the server refused to process the request for security or policy reasons (REFUSED).

\value NotFoundError the requested domain name does not exist (NXDOMAIN).

\value TimeoutError the server was not reached or did not reply in time (since 6.6).

Enumerator
NoError 
ResolverError 
OperationCancelledError 
InvalidRequestError 
InvalidReplyError 
ServerFailureError 
ServerRefusedError 
NotFoundError 
TimeoutError 

Definition at line 232 of file qdnslookup.h.

◆ Protocol

Indicates the type of DNS server that is being queried.

\value Standard Regular, unencrypted DNS, using UDP and falling back to TCP as necessary (default port: 53)

\value DnsOverTls Encrypted DNS over TLS (DoT, as specified by \l{RFC 7858}), over TCP (default port: 853)

See also
isProtocolSupported(), nameserverProtocol, setNameserver()
Enumerator
Standard 
DnsOverTls 

Definition at line 261 of file qdnslookup.h.

◆ Type

Indicates the type of DNS lookup that was performed.

\value A IPv4 address records.

\value AAAA IPv6 address records.

\value ANY any records.

\value CNAME canonical name records.

\value MX mail exchange records.

\value NS name server records.

\value PTR pointer records.

\value SRV service records.

\value[since 6.8] TLSA TLS association records.

\value TXT text records.

Enumerator
AAAA 
ANY 
CNAME 
MX 
NS 
PTR 
SRV 
TLSA 
TXT 

Definition at line 246 of file qdnslookup.h.

Constructor & Destructor Documentation

◆ QDnsLookup() [1/5]

QDnsLookup::QDnsLookup ( QObject * parent = nullptr)
explicit

Constructs a QDnsLookup object and sets parent as the parent object.

The \l type property will default to QDnsLookup::A.

Definition at line 352 of file qdnslookup.cpp.

◆ QDnsLookup() [2/5]

QDnsLookup::QDnsLookup ( Type type,
const QString & name,
QObject * parent = nullptr )

Constructs a QDnsLookup object for the given type and name and sets parent as the parent object.

Definition at line 362 of file qdnslookup.cpp.

◆ QDnsLookup() [3/5]

QDnsLookup::QDnsLookup ( Type type,
const QString & name,
const QHostAddress & nameserver,
QObject * parent = nullptr )
Since
5.4

Constructs a QDnsLookup object to issue a query for name of record type type, using the DNS server nameserver running on the default DNS port, and sets parent as the parent object.

Definition at line 379 of file qdnslookup.cpp.

◆ QDnsLookup() [4/5]

QDnsLookup::QDnsLookup ( Type type,
const QString & name,
const QHostAddress & nameserver,
quint16 port,
QObject * parent = nullptr )
\fn QDnsLookup::QDnsLookup(Type type, const QString &name, const QHostAddress &nameserver, quint16 port, QObject *parent)
\since 6.6

Constructs a QDnsLookup object to issue a query for \a name of record type
\a type, using the DNS server \a nameserver running on port \a port, and
sets \a parent as the parent object.

! [nameserver-port]

Note
Setting the port number to any value other than the default (53) can cause the name resolution to fail, depending on the operating system limitations and firewalls, if the nameserverProtocol() to be used QDnsLookup::Standard. Notably, the Windows API used by QDnsLookup is unable to handle alternate port numbers. ! [nameserver-port]

Definition at line 400 of file qdnslookup.cpp.

◆ QDnsLookup() [5/5]

QDnsLookup::QDnsLookup ( Type type,
const QString & name,
Protocol protocol,
const QHostAddress & nameserver,
quint16 port = 0,
QObject * parent = nullptr )
Since
6.8

Constructs a QDnsLookup object to issue a query for name of record type type, using the DNS server nameserver running on port port, and sets parent as the parent object.

The query will be sent using protocol, if supported. Use isProtocolSupported() to check if it is supported.

nameserver-port

Definition at line 422 of file qdnslookup.cpp.

◆ ~QDnsLookup()

QDnsLookup::~QDnsLookup ( )

Destroys the QDnsLookup object.

It is safe to delete a QDnsLookup object even if it is not finished, you will simply never receive its results.

Definition at line 441 of file qdnslookup.cpp.

Member Function Documentation

◆ abort

void QDnsLookup::abort ( )
slot

Aborts the DNS lookup operation.

If the lookup is already finished, does nothing.

Definition at line 756 of file qdnslookup.cpp.

◆ bindableName()

QBindable< QString > QDnsLookup::bindableName ( )

Definition at line 519 of file qdnslookup.cpp.

◆ bindableNameserver()

QBindable< QHostAddress > QDnsLookup::bindableNameserver ( )

Definition at line 563 of file qdnslookup.cpp.

◆ bindableNameserverPort()

QBindable< quint16 > QDnsLookup::bindableNameserverPort ( )

Definition at line 591 of file qdnslookup.cpp.

◆ bindableNameserverProtocol()

QBindable< QDnsLookup::Protocol > QDnsLookup::bindableNameserverProtocol ( )

Definition at line 614 of file qdnslookup.cpp.

◆ bindableType()

QBindable< QDnsLookup::Type > QDnsLookup::bindableType ( )

Definition at line 541 of file qdnslookup.cpp.

◆ canonicalNameRecords()

QList< QDnsDomainNameRecord > QDnsLookup::canonicalNameRecords ( ) const

Returns the list of canonical name records associated with this lookup.

Definition at line 643 of file qdnslookup.cpp.

◆ defaultPortForProtocol()

quint16 QDnsLookup::defaultPortForProtocol ( Protocol protocol)
staticnoexcept
Since
6.8

Returns the standard (default) port number for the protocol protocol.

See also
isProtocolSupported()

Definition at line 315 of file qdnslookup.cpp.

◆ error()

QDnsLookup::Error QDnsLookup::error ( ) const

Definition at line 472 of file qdnslookup.cpp.

◆ errorString()

QString QDnsLookup::errorString ( ) const

Definition at line 482 of file qdnslookup.cpp.

◆ finished

void QDnsLookup::finished ( )
signal

This signal is emitted when the reply has finished processing.

◆ hostAddressRecords()

QList< QDnsHostAddressRecord > QDnsLookup::hostAddressRecords ( ) const

Returns the list of host address records associated with this lookup.

Definition at line 652 of file qdnslookup.cpp.

◆ isAuthenticData()

bool QDnsLookup::isAuthenticData ( ) const

Definition at line 462 of file qdnslookup.cpp.

◆ isFinished()

bool QDnsLookup::isFinished ( ) const

Returns whether the reply has finished or was aborted.

Definition at line 491 of file qdnslookup.cpp.

◆ isProtocolSupported()

bool QDnsLookup::isProtocolSupported ( Protocol protocol)
static
Since
6.8

Returns true if DNS queries using protocol are supported with QDnsLookup.

See also
nameserverProtocol

Definition at line 289 of file qdnslookup.cpp.

◆ lookup

void QDnsLookup::lookup ( )
slot

Performs the DNS lookup.

The \l{QDnsLookup::finished()}{finished()} signal is emitted upon completion.

Definition at line 775 of file qdnslookup.cpp.

◆ mailExchangeRecords()

QList< QDnsMailExchangeRecord > QDnsLookup::mailExchangeRecords ( ) const

Returns the list of mail exchange records associated with this lookup.

The records are sorted according to \l{http://www.rfc-editor.org/rfc/rfc5321.txt}{RFC 5321}, so if you use them to connect to servers, you should try them in the order they are listed.

Definition at line 665 of file qdnslookup.cpp.

◆ name()

QString QDnsLookup::name ( ) const

Definition at line 508 of file qdnslookup.cpp.

◆ nameChanged

void QDnsLookup::nameChanged ( const QString & name)
signal

This signal is emitted when the lookup \l name changes.

name is the new lookup name.

◆ nameserver()

QHostAddress QDnsLookup::nameserver ( ) const

Definition at line 552 of file qdnslookup.cpp.

◆ nameserverChanged

void QDnsLookup::nameserverChanged ( const QHostAddress & nameserver)
signal

◆ nameserverPort()

quint16 QDnsLookup::nameserverPort ( ) const

Definition at line 580 of file qdnslookup.cpp.

◆ nameserverPortChanged

void QDnsLookup::nameserverPortChanged ( quint16 port)
signal

◆ nameserverProtocol()

QDnsLookup::Protocol QDnsLookup::nameserverProtocol ( ) const

Definition at line 604 of file qdnslookup.cpp.

◆ nameserverProtocolChanged

void QDnsLookup::nameserverProtocolChanged ( QDnsLookup::Protocol protocol)
signal

◆ nameServerRecords()

QList< QDnsDomainNameRecord > QDnsLookup::nameServerRecords ( ) const

Returns the list of name server records associated with this lookup.

Definition at line 674 of file qdnslookup.cpp.

◆ pointerRecords()

QList< QDnsDomainNameRecord > QDnsLookup::pointerRecords ( ) const

Returns the list of pointer records associated with this lookup.

Definition at line 683 of file qdnslookup.cpp.

◆ serviceRecords()

QList< QDnsServiceRecord > QDnsLookup::serviceRecords ( ) const

Returns the list of service records associated with this lookup.

The records are sorted according to \l{http://www.rfc-editor.org/rfc/rfc2782.txt}{RFC 2782}, so if you use them to connect to servers, you should try them in the order they are listed.

Definition at line 696 of file qdnslookup.cpp.

◆ setName()

void QDnsLookup::setName ( const QString & name)

Definition at line 513 of file qdnslookup.cpp.

◆ setNameserver() [1/3]

void QDnsLookup::setNameserver ( const QHostAddress & nameserver)

Definition at line 557 of file qdnslookup.cpp.

◆ setNameserver() [2/3]

void QDnsLookup::setNameserver ( const QHostAddress & nameserver,
quint16 port )
Since
6.6

Sets the nameserver to nameserver and the port to port.

nameserver-port

See also
QDnsLookup::nameserver, QDnsLookup::nameserverPort

◆ setNameserver() [3/3]

void QDnsLookup::setNameserver ( Protocol protocol,
const QHostAddress & nameserver,
quint16 port = 0 )

Definition at line 630 of file qdnslookup.cpp.

◆ setNameserverPort()

void QDnsLookup::setNameserverPort ( quint16 port)

Definition at line 585 of file qdnslookup.cpp.

◆ setNameserverProtocol()

void QDnsLookup::setNameserverProtocol ( Protocol protocol)

Definition at line 609 of file qdnslookup.cpp.

◆ setType()

void QDnsLookup::setType ( QDnsLookup::Type )

Definition at line 535 of file qdnslookup.cpp.

◆ textRecords()

QList< QDnsTextRecord > QDnsLookup::textRecords ( ) const

Returns the list of text records associated with this lookup.

Definition at line 705 of file qdnslookup.cpp.

◆ tlsAssociationRecords()

QList< QDnsTlsAssociationRecord > QDnsLookup::tlsAssociationRecords ( ) const
Since
6.8 Returns the list of TLS association records associated with this lookup.

According to the standards relating to DNS-based Authentication of Named Entities (DANE), this field should be ignored and must not be used for verifying the authentity of a given server if the authenticity of the DNS reply cannot itself be confirmed. See isAuthenticData() for more information.

Definition at line 720 of file qdnslookup.cpp.

◆ type()

QDnsLookup::Type QDnsLookup::type ( ) const

Definition at line 530 of file qdnslookup.cpp.

◆ typeChanged

void QDnsLookup::typeChanged ( QDnsLookup::Type type)
signal

This signal is emitted when the lookup \l type changes.

type is the new lookup type.

Property Documentation

◆ authenticData

bool QDnsLookup::authenticData
read

whether the reply was authenticated by the resolver.

Since
6.8

QDnsLookup does not perform the authentication itself. Instead, it trusts the name server that was queried to perform the authentication and report it. The application is responsible for determining if any servers it configured with setNameserver() are trustworthy; if no server was set, QDnsLookup obeys system configuration on whether responses should be trusted.

This property may be set even if error() indicates a resolver error occurred.

See also
setNameserver(), nameserverProtocol()

Definition at line 220 of file qdnslookup.h.

◆ error

Error QDnsLookup::error
read

the type of error that occurred if the DNS lookup failed, or NoError.

Definition at line 219 of file qdnslookup.h.

◆ errorString

QString QDnsLookup::errorString
read

a human-readable description of the error if the DNS lookup failed.

Definition at line 221 of file qdnslookup.h.

◆ name

QString QDnsLookup::name
readwrite

the name to lookup.

If the name to look up is empty, QDnsLookup will attempt to resolve the root domain of DNS. That query is usually performed with QDnsLookup::type set to \l{QDnsLookup::Type}{NS}.

Note
The name will be encoded using IDNA, which means it's unsuitable for querying SRV records compatible with the DNS-SD specification.

Definition at line 222 of file qdnslookup.h.

Referenced by testing.tools.encode_pdf_filter._PdfStream::RegisterByName().

◆ nameserver

QHostAddress QDnsLookup::nameserver
readwrite

the nameserver to use for DNS lookup.

Definition at line 224 of file qdnslookup.h.

◆ nameserverPort

quint16 QDnsLookup::nameserverPort
readwrite

the port number of nameserver to use for DNS lookup.

Since
6.6

The value of 0 indicates that QDnsLookup should use the default port for the nameserverProtocol().

nameserver-port

Definition at line 226 of file qdnslookup.h.

◆ nameserverProtocol

Protocol QDnsLookup::nameserverProtocol
readwrite

the protocol to use when sending the DNS query

Since
6.8
See also
isProtocolSupported()

Definition at line 228 of file qdnslookup.h.

◆ type

Type QDnsLookup::type
readwrite

the type of DNS lookup.

Definition at line 223 of file qdnslookup.h.


The documentation for this class was generated from the following files: