# Duplicate hostname: two hosts, one name, flapping data
What you see: a host page whose metrics jump between two realities, CPU from host A then host B. Or one host that is never quite right. Monitors on it flap.
## How it happens
- **Cloned VMs / AMIs.** The image baked in a hostname or a machine-id and every clone reports the same name.
- **Containers sharing a hostname.** Every container in a pod or task reporting the host default.
- **hostname set explicitly and copy-pasted** across a fleet in `datadog.yaml`.
## Diagnose
In the app, the host page shows interleaved data from two sources: different instance IDs, different IPs, same name. On the hosts themselves, compare `hostname` output and the agent status hostname line. Two boxes, same string, found it.
## Fix
- Give each host a unique hostname at the OS level (cloud-init, DHCP, whatever your fleet uses).
- Or set `hostname:` explicitly per host in `datadog.yaml` (unique per host, obviously).
- In containers, make sure the agent resolves the node/pod name, not a shared default; the container hostname docs cover the precedence.
- After fixing, the phantom host entry ages out. Do not delete-and-recreate monitors; they key off tags, and the tags are now stable.
## Prevention
Bake hostname assignment into provisioning, not into the Datadog config. The Datadog hostname should always derive from something already unique about the machine.