# DNS resolution failed in CI

Classification: environment
Frameworks: CI, Jest, Playwright
Canonical: https://automationtester.in/failures/dns-resolution-failed-in-ci

## Recognizable error

```text
getaddrinfo ENOTFOUND service-name
```

## What it means

The runtime could not translate a configured host name into an address in the CI environment.

## Ranked causes, checks, and fixes

### 1. The service alias is missing

The test expects a container or CI service name that was not declared.

Diagnostic: List the services and inspect the resolved environment variable without printing credentials.

Fix: Declare the service with the expected alias or update the base host.

### 2. A production-only hostname leaked into tests

Environment precedence may select an unreachable host.

Diagnostic: Trace which env file or secret sets the host in this job.

Fix: Use an explicit test configuration and validate it before the suite starts.

### 3. DNS was temporarily unavailable

Runner or network instability can cause a transient lookup failure.

Diagnostic: Compare failures across unrelated hosts and runner instances.

Fix: Retry only the readiness probe with a short bound, then surface the runner as unhealthy.

## Prevention

- Validate hosts before tests.
- Use stable CI service aliases.
- Do not silently fall back to production endpoints.

## Primary references

- [Node.js common system errors](https://nodejs.org/api/errors.html#common-system-errors)

Triage this failure locally: https://automationtester.in/tools/test-failure-triage