<!-- Source: @site/projects/sqlens-for-laravel/docs/rules/cap-l0-pinned-host-diverged.md -->
<!-- Canonical: https://docs.pushery.com/sqlens-for-laravel/rules/cap-l0-pinned-host-diverged/ -->

# CAP.L0.PINNED_HOST_DIVERGED — the server that answered is not the one that was pinned

> A pin that did not take effect makes every finding a statement about a database nobody asked for, and it looks exactly like a real report.

- **Category:** safety
- **Level:** 0
- **Stability:** stable
- **Suites:** audit

`--host` was given, the connection opened, and the server that answered reports a different address
than the one that was pinned. The run stops before a single catalog row is read.

## Why before the read rather than after

Reading a server the operator did not choose is itself the harm, not merely a reporting mistake. Once
the catalog has been read, every finding below is a true statement about the wrong database — and the
report is indistinguishable from a correct one.

## What causes it

Usually a layer between the pin and the server: a connection pooler or proxy that routes by its own
rules, a DNS name resolving somewhere unexpected, or a `url`-configured connection whose host the
framework overrides after the pin was applied.

## What to do

The notice names both addresses — the one that was pinned and the one that answered. Reconcile them:
pin the address the pooler actually fronts, or address the server directly.

## Related

- [Read/write splits and replicas](https://docs.pushery.com/sqlens-for-laravel/read-write-split.md)
- [Pinned host unverified](https://docs.pushery.com/sqlens-for-laravel/rules/cap-l0-pinned-host-unverified.md) — the weaker case, where the server would not say
