diff --git kio/kio/hostinfo.cpp kio/kio/hostinfo.cpp
index fcb7889..c1c76a3 100644
--- kio/kio/hostinfo.cpp
+++ kio/kio/hostinfo.cpp
@@ -32,6 +32,7 @@ License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 #include <QtCore/QFutureWatcher>
 #include <QtCore/QMetaType>
 #include <QtCore/QtConcurrentRun>
+#include <QtCore/QEventLoop>
 #include <QtNetwork/QHostInfo>
 #include "kdebug.h"
 
@@ -58,12 +59,16 @@ namespace KIO
         HostInfoAgentPrivate(int cacheSize = 100);
         virtual ~HostInfoAgentPrivate() {};
         void lookupHost(const QString& hostName, QObject* receiver, const char* member);
+        void lookupHost(const QString& hostName, unsigned long timeout, QHostInfo* info);
         QHostInfo lookupCachedHostInfoFor(const QString& hostName);
         void cacheLookup(const QHostInfo&);
         void setCacheSize(int s) { dnsCache.setMaxCost(s); }
         void setTTL(int _ttl) { ttl = _ttl; }
-    private slots:
+    private Q_SLOTS:
         void queryFinished(const QHostInfo&);
+        void lookupResult(const QHostInfo&);
+    Q_SIGNALS:
+        void lookupDone();
     private:
         class Result;
         class Query;
@@ -77,7 +82,7 @@ namespace KIO
     class HostInfoAgentPrivate::Result : public QObject
     {
         Q_OBJECT
-    signals:
+    Q_SIGNALS:
         void result(QHostInfo);
     private:
         friend class HostInfoAgentPrivate;
@@ -101,9 +106,9 @@ namespace KIO
         {
             return m_hostName;
         }
-    signals:
+    Q_SIGNALS:
         void result(QHostInfo);
-    private slots:
+    private Q_SLOTS:
         void relayFinished()
         {
             emit result(m_watcher.result());
@@ -112,57 +117,6 @@ namespace KIO
         QFutureWatcher<QHostInfo> m_watcher;
         QString m_hostName;
     };
-
-    class NameLookUpThread : public QThread
-    {
-    public:
-        NameLookUpThread (const QString& name)
-            :QThread (0), m_hostName(name), m_started(false)
-        {
-        }
-
-        QHostInfo result() const
-        {
-          return m_hostInfo;
-        }
-
-        bool wasStarted() const
-        {
-            return m_started;
-        }
-
-        void run()
-        {
-            m_started = true;
-            m_hostInfo = QHostInfo();
-
-            // Do not perform a reverse lookup here...
-            QHostAddress address (m_hostName);
-            if (!address.isNull()) {
-                QList<QHostAddress> addressList;
-                addressList << address;
-                m_hostInfo.setAddresses(addressList);
-                return;
-            }
-
-            // Look up the name in the KIO/KHTML DNS cache...
-            m_hostInfo = HostInfo::lookupCachedHostInfoFor(m_hostName);
-            if (!m_hostInfo.hostName().isEmpty() && m_hostInfo.error() == QHostInfo::NoError) {
-                return;
-            }
-
-            // Failing all of the above, do the lookup...
-            m_hostInfo = QHostInfo::fromName(m_hostName);
-            if (!m_hostInfo.hostName().isEmpty() && m_hostInfo.error() == QHostInfo::NoError) {
-                HostInfo::cacheLookup(m_hostInfo); // cache the look up...
-            }
-        }
-
-    private:
-        QHostInfo m_hostInfo;
-        QString m_hostName;
-        bool m_started;
-    };
 }
 
 using namespace KIO;
@@ -177,24 +131,9 @@ void HostInfo::lookupHost(const QString& hostName, QObject* receiver,
 
 QHostInfo HostInfo::lookupHost(const QString& hostName, unsigned long timeout)
 {
-    NameLookUpThread lookupThread (hostName);
-    lookupThread.start();
-
-    // Wait for it to start...
-    while (!lookupThread.wasStarted()) {
-       kDebug() << "Waiting for name lookup thread to start";
-       lookupThread.wait(1000);
-    }
-
-    // Now wait for it to complete...
-    if (!lookupThread.wait(timeout)) {
-        kDebug() << "Name look up for" << hostName << "failed";
-        lookupThread.terminate();
-        return QHostInfo();
-    }
-
-    //kDebug(7022) << "Name look up succeeded for" << hostName;
-    return lookupThread.result();
+    QHostInfo hostInfo;
+    hostInfoAgentPrivate->lookupHost(hostName, timeout, &hostInfo);
+    return hostInfo;
 }
 
 QHostInfo HostInfo::lookupCachedHostInfoFor(const QString& hostName)
@@ -209,7 +148,8 @@ void HostInfo::cacheLookup(const QHostInfo& info)
 
 void HostInfo::prefetchHost(const QString& hostName)
 {
-    hostInfoAgentPrivate->lookupHost(hostName, 0, 0);
+    QObject* reciever =  0;
+    hostInfoAgentPrivate->lookupHost(hostName, reciever, 0);
 }
 
 void HostInfo::setCacheSize(int s)
@@ -273,6 +213,50 @@ void HostInfoAgentPrivate::lookupHost(const QString& hostName,
     query->start(hostName);
 }
 
+void HostInfoAgentPrivate::lookupHost(const QString& hostName,
+                                      unsigned long timeout, QHostInfo* info)
+{
+    Q_ASSERT(info);
+    if (!info) {
+        return;
+    }
+
+    // Do not perform a reverse lookup here...
+    QHostAddress address (hostName);
+    if (!address.isNull()) {
+        QList<QHostAddress> addressList;
+        addressList << address;
+        info->setAddresses(addressList);
+        return;
+    }
+
+    // Look up the name in the KIO/KHTML DNS cache...
+    *info = lookupCachedHostInfoFor(hostName);
+    if (!info->hostName().isEmpty() && info->error() == QHostInfo::NoError) {
+        return;
+    }
+
+    // Failing all of the above, do the lookup using local event loop to honor timeout.
+    QTimer timer;    
+    timer.setInterval(timeout);
+    timer.setSingleShot(true);   
+    QEventLoop eventLoop;
+    connect(&timer, SIGNAL(timeout()), &eventLoop, SLOT(quit()));
+    connect(this, SIGNAL(lookupDone()), &eventLoop, SLOT(quit()));
+    const int id = QHostInfo::lookupHost(hostName, this, SLOT(lookUpResult(QHostInfo)));
+    timer.start();
+    eventLoop.exec();
+
+    // timed out...
+    if (!timer.isActive()) {
+        return;
+    }
+    
+    timer.stop();
+    QHostInfo::abortHostLookup(id);
+    *info = lookupCachedHostInfoFor(hostName);
+}
+
 QHostInfo HostInfoAgentPrivate::lookupCachedHostInfoFor(const QString& hostName)
 {
     QPair<QHostInfo, QTime>* info = dnsCache.object(hostName);
@@ -304,4 +288,10 @@ void HostInfoAgentPrivate::queryFinished(const QHostInfo& info)
     query->deleteLater();
 }
 
+void HostInfoAgentPrivate::lookupResult(const QHostInfo& info)
+{
+    cacheLookup(info);
+    emit lookupDone();
+}
+
 #include "hostinfo.moc"
