> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getunbound.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Path Conflicts

> Fix conflicts when another program shadows the unbound command

If `unbound --version` fails, prints unexpected output, or seems to invoke a different program, another tool on your system likely owns the `unbound` name and is taking precedence on your `PATH`.

## `command not found: unbound`

If the shell can't find the command **at all** — as opposed to finding the wrong one — check whether it's installed:

```bash theme={null}
npm ls -g unbound-cli
```

* **Not listed** — install it: `npm install -g unbound-cli`
* **Listed, but still not found** — it's installed somewhere that isn't on your `PATH`. Follow the Fix section below.

If a scheduled Unbound scan is failing this way, its log names both the path recorded at setup time and the current one. That usually means a Node version manager moved the global bin directory after the schedule was created — reinstall the CLI, then re-run `unbound discover --set-cron`.

If `unbound` resolves to *something*, just not the Unbound CLI, that's the shadowing problem this page covers. Keep reading.

## Diagnosis

Compare which binary each alias resolves to:

```bash theme={null}
which unbound
which unbound-cli
```

If `unbound-cli` points at the Unbound CLI but `unbound` points elsewhere (or to nothing), something earlier on your `PATH` is shadowing it. Use `unbound-cli` directly while you investigate:

```bash theme={null}
unbound-cli --version
```

Inspect the conflicting path:

```bash theme={null}
type -a unbound
ls -l "$(which unbound)"
```

## Common Causes

* A package providing an `unbound` binary was installed before `unbound-cli` and lives in an earlier `PATH` entry (e.g. `/usr/local/bin`, `/opt/homebrew/bin`, `/usr/sbin`). The system DNS resolver `unbound` from NLnet Labs is a frequent culprit on macOS and Linux.
* A shell alias or function defined in `~/.zshrc`, `~/.bashrc`, or `~/.profile` is overriding the command. Check with `alias unbound` and `type unbound`.
* A previous install left a stale symlink. Remove it, or reorder your `PATH` so the npm global bin directory comes first.

## Fix

Find your npm global bin directory:

```bash theme={null}
npm config get prefix
```

The bin directory is the `prefix` path with `/bin` appended — so a prefix of `/usr/local` gives `/usr/local/bin`, and `/opt/homebrew` gives `/opt/homebrew/bin`. Add it to the front of your `PATH` in `~/.zshrc` or `~/.bashrc`:

```bash theme={null}
export PATH="$(npm config get prefix)/bin:$PATH"
```

Reload your shell:

```bash theme={null}
source ~/.zshrc   # or ~/.bashrc
```

Once `which unbound` and `which unbound-cli` resolve to the same path under your npm global install, the conflict is resolved.

## On Windows

```powershell theme={null}
Get-Command unbound -All
Get-Command unbound-cli
npm config get prefix
```

`Get-Command … -All` lists every match in `PATH` order, so the first row is the one that wins. On Windows the npm global bin directory is the `prefix` path itself rather than `prefix\bin` — put it ahead of the conflicting entry in your user `PATH` and open a new terminal.
