# aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api.internal:443 ssl:default [Name or service not known]

- **ID:** `python/aiohttp-cannot-connect-to-host-name-not-known`
- **Domain:** python
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

DNS resolution failed for the hostname; inside containers this often means the resolver config (/etc/resolv.conf) or the hostname itself is wrong, or async DNS is blocked.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   import socket
socket.getaddrinfo('api.internal', 443)  # test from Python
# then: cat /etc/resolv.conf and ensure the nameserver is reachable
   ```
2. **** (82% success)
   ```
   try:
    import aiodns
    conn = aiohttp.TCPConnector(resolver=aiohttp.AsyncResolver())
except ImportError:
    conn = aiohttp.TCPConnector()  # default ThreadedResolver
   ```

## Dead Ends

- **** — The failure is DNS, not TLS; disabling SSL has no effect on name resolution. (90% fail)
- **** — Resolution fails immediately with NXDOMAIN; waiting longer does not help. (85% fail)
