sqlmapproject/sqlmap · error · SqlmapConnectionException

host ' ' does not exist

Error message

host '%s' does not exist

What it means

checkConnection raised this when DNS resolution of the target hostname failed with socket.gaierror: the host does not exist (or cannot currently be resolved). No HTTP request can be made to an unresolvable target, so sqlmap aborts the connection check before testing begins.

Solutions

  1. Verify the hostname spelling in the target URL.
  2. Check DNS configuration (resolv.conf, /etc/hosts, corporate DNS) and network connectivity.
  3. Use the IP address directly instead of the hostname if DNS is unavailable.
  4. If behind a proxy or Tor, ensure name resolution happens where it should (proxy-side).
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at lib/controller/checks.py:1759 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/d8edfd8df812c91c. Report an issue: GitHub.

Appendix: source

Thrown at lib/controller/checks.py:1759

        finally:
            kb.pageCompress = popValue()
            kb.nullConnection = False if kb.nullConnection is None else kb.nullConnection
            hashDBWrite(HASHDB_KEYS.CHECK_NULL_CONNECTION_RESULT, kb.nullConnection, True)

    return kb.nullConnection in getPublicTypeMembers(NULLCONNECTION, True)

def checkConnection(suppressOutput=False):
    threadData = getCurrentThreadData()

    if not re.search(r"\A\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\Z", conf.hostname):
        if not any((conf.proxy, conf.tor, conf.dummy, conf.offline)):
            try:
                debugMsg = "resolving hostname '%s'" % conf.hostname
                logger.debug(debugMsg)
                socket.getaddrinfo(conf.hostname, None)
            except socket.gaierror:
                errMsg = "host '%s' does not exist" % conf.hostname
                raise SqlmapConnectionException(errMsg)
            except socket.error as ex:
                errMsg = "problem occurred while "
                errMsg += "resolving a host name '%s' ('%s')" % (conf.hostname, getSafeExString(ex))
                raise SqlmapConnectionException(errMsg)
            except UnicodeError as ex:
                errMsg = "problem occurred while "
                errMsg += "handling a host name '%s' ('%s')" % (conf.hostname, getSafeExString(ex))
                raise SqlmapDataException(errMsg)

    if not suppressOutput and not conf.dummy and not conf.offline:
        infoMsg = "testing connection to the target URL"
        logger.info(infoMsg)

    try:
        kb.originalPageTime = time.time()
        page, headers, _ = Request.queryPage(content=True, noteResponseTime=False)

        rawResponse = "%s%s" % (listToStrValue(headers.headers if headers else ""), page)

View on GitHub (pinned to 0a35b20e39)