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

# CAP.L0.UNOFFERED_HOST — the named host is not one this connection configures

> A host pin that the configuration does not offer is refused, never dialed. Auditing a server the project never configured is worse than not running.

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

`--host` names one of the hosts a connection **already configures**. A value that is not among them
is refused here rather than connected to.

## Why refused rather than obeyed

Connecting anyway would audit a server the project never configured, and then report it as the
project's database. That is worse than not running at all: the output is a normal-looking report
about the wrong machine, and nothing in it says so.

It is also a credentials question. Dialing an operator-named host means sending the project's
database credentials over the network to a machine the configuration has never heard of.

## A connection that offers no host at all

A socket connection, a DSN, or a `url`-configured connection names no host. Offering nothing is not
offering everything, so a pin against one of those is refused too. Point `--host` at a connection
that configures hosts, or drop the flag.

## What to do

The notice lists what the connection does offer. Pick one of those, or correct the connection's
configuration if the host you meant genuinely belongs there.

## Related

- [Read/write splits and replicas](https://docs.pushery.com/sqlens-for-laravel/read-write-split.md)
- [Ambiguous read hosts](https://docs.pushery.com/sqlens-for-laravel/rules/cap-l0-ambiguous-read-hosts.md) — the opposite case: several offered, none chosen
