> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/configure-web-targets/configure-extra-hosts.md).

# Configure extra hosts

How to configure extra hosts for Snyk API & Web web targets

{% hint style="info" %}
**Snyk is rolling out a new navigation.** The steps on this page describe the classic interface. If your view looks different, visit [Navigate the Snyk Web UI](https://docs.snyk.io/navigate-the-snyk-web-ui#where-things-moved) to map these options to the new interface.
{% endhint %}

## Configure extra hosts

Include additional domains in the scan scope when your web application uses multiple hostnames, such as separate domains for front-end and back-end APIs.

### What are extra hosts?

When you add a target, Snyk API & Web scans only pages under that target URL. The scanner does not scan pages from different hostnames unless you add them as extra hosts.

This default behavior can present challenges for single-page applications (SPAs) where the front-end is built with JavaScript and the server-side functionality is invoked using an API. In SPAs, APIs are typically hosted under a different subdomain (such as `api.example.com`) while the front-end resides on `app.example.com`. In some cases, the API can be an entirely separate domain.

When you configure extra hosts, Snyk follows and scans any `XMLHttpRequest` performed to the specified hostnames. If a hostname is in the extra hosts list, the scanner regards it as within the scanning scope and analyzes the API responses for vulnerabilities.

### When to use extra hosts

Use extra hosts when your web application architecture includes:

* Separate API domains: front-end on `app.example.com` accessing an API on `api.example.com`.
* Multiple subdomains: different subdomains serving various application functions.
* Content delivery networks: assets served from different domains that need security testing.

If Snyk scans only the front-end domain, it can miss critical security tests in the API that drives much of your application's functionality. Adding extra hosts ensures complete coverage of your application's security surface.

### Add extra hosts

To add extra hosts to your target:

1. Navigate to the **Targets** list.
2. Find your target in the list and click the **gear icon** to access the target settings.
3. Navigate to the **Extra Hosts** tab.
4. In the **Add hostname** field, enter the hostname you want to include in the scan scope.
5. Click **Add**.

You can add multiple extra hosts to a single target. The scanner tests each configured hostname during scans.

### Verify domain ownership

After adding an extra host, ensure that its hostname is under a verified domain. Snyk API & Web requires domain ownership verification to prevent unauthorized scanning of domains you do not control.

Visit [Verify domain ownership](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/verify-domain-ownership.md) to learn how to verify ownership of your domains.

By including extra hosts and scanning both the front-end and associated APIs, you gain a complete picture of your web application's security posture.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snyk.io/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/configure-web-targets/configure-extra-hosts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
