> 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/troubleshooting/domain-verification/troubleshooting-verify-domain-txt-file.md).

# Troubleshoot domain verification with TXT file

How to troubleshoot domain verification with a TXT file in Snyk API & Web

{% 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 %}

## Troubleshoot domain verification with TXT file

To run full scans, you must verify domain ownership. Visit [Verify domain ownership](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/verify-domain-ownership.md) to learn why verification is required.

### The problem

Domain verification using a TXT file fails with the error: `Token file not found.`

### Troubleshoot the problem

Work through the following steps to identify possible causes and solutions.

#### Step 1: Test direct access

Test if the TXT file can be accessed directly.

**Using a browser:**

1. Open a browser and navigate to:

   ```
   https://<domain_to_verify>/<your_file_name>.txt
   ```

   For example:

   ```
   https://example.com/00000000-0000-0000-0000-000000000000.txt
   ```

**Using curl:**

```bash
curl -i https://<domain_to_verify>/<your_file_name>.txt
```

For example:

```bash
curl -i https://example.com/00000000-0000-0000-0000-000000000000.txt
```

If the request fails with a **404 - Not Found** error, the file is not directly accessible, and Snyk API & Web cannot verify the domain.

Check the following causes and solutions:

| Cause                                                                                  | Solution                                                                                                                                                                                           |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The TXT file does not exist in the server's root folder.                               | Ensure the file is in the server's root folder. Visit [Verify with TXT file](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/verify-domain-ownership/verify-with-txt-file.md). |
| The TXT file is in the server's root folder but does not have the correct permissions. | Ensure the file has the correct permissions for Snyk API & Web to access it.                                                                                                                       |

#### Step 2: Test redirects

Test if there are redirects when accessing the TXT file.

**Using a browser:**

1. Open a browser and navigate to:

   ```
   https://<domain_to_verify>/<your_file_name>.txt
   ```

**Using curl:**

```bash
curl -i https://<domain_to_verify>/<your_file_name>.txt
```

If there is a redirect, the TXT file is fetched from another URL, and Snyk API & Web cannot verify the domain.

For example, `https://example.com/00000000-0000-0000-0000-000000000000.txt` could redirect to `https://www.example.com/00000000-0000-0000-0000-000000000000.txt`.

Check the following cause and solution:

| Cause                                        | Solution                                                                                                                                         |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| The file's URL is redirected to another URL. | Create a target with the domain of the redirected URL. In the preceding example, create a target for `www.example.com` instead of `example.com`. |

#### Step 3: Test blockers

Test if human checks (for example, a CAPTCHA) or Web Application Firewalls (WAFs) are blocking access to the TXT file.

1. Open a browser in incognito mode.
2. Navigate to:

   ```
   https://<domain_to_verify>/<your_file_name>.txt
   ```

If a human check appears or a WAF blocks access to the TXT file, Snyk API & Web cannot verify the domain.

Check the following causes and solutions:

| Cause                                         | Solution                                                                                                                                                                                                       |
| --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A human check is blocking access to the file. | Remove the human check when accessing the TXT file.                                                                                                                                                            |
| A WAF is blocking access to the file.         | Add Snyk API & Web IPs to the WAF's allowlist. Visit [Configure IPs in WAFs](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/start-scanning/overview-scan-access-and-connectivity/configure-ips-in-wafs.md). |

After following these steps and applying the solutions, you can verify the domain using a TXT file.

For more information, visit [Verify with TXT file](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/verify-domain-ownership/verify-with-txt-file.md).


---

# 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/troubleshooting/domain-verification/troubleshooting-verify-domain-txt-file.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.
