I have multiples DNS record (MX, CNAME , TXT) and I would like to read the TXT record content.
Is it possible?
Is there any example?
Thanks.
Printable View
I have multiples DNS record (MX, CNAME , TXT) and I would like to read the TXT record content.
Is it possible?
Is there any example?
Thanks.
Could you help me, please?
The lookup() function never emit finished() or error(), I tried using this code:
Code:
m_dns = new QDnsLookup(this); connect(m_dns, SIGNAL(finished()), this, SLOT(onHandle())); m_dns->setType(QDnsLookup::TXT); m_dns->setName("uol.com.br"); m_dns->lookup(); void Update::onHandle() { if (m_dns->error() != QDnsLookup::NoError) qDebug() << m_dns->error() << m_dns->errorString(); foreach (const QDnsServiceRecord &record, m_dns->serviceRecords()) { qDebug() << "Name: " << record.name() << "Target: " << record.target(); } emit handled(); }
Thanks any help,
QDnsLookup appears to use a thread pool to perform its DNS lookup requests. Do you have an event loop running at the time you do the m_dns->lookup()?
Edit: Also, you said you're looking for TXT records, so your OnHandle slot should be looking at m_dns->textRecords(), not m_dns->serviceRecords(), correct?
Thank you very much! It is working with m_dns->textRecords()
Glad its working for you, but I thought your issue was that the finished() signal was never fired? What did you change to get that working?