# IP 版本

默认情况下，我们的住宅代理同时包含 IPv4 和 IPv6 地址。如有需要，您可以选择互联网协议 (IP) 版本以 **仅接收 IPv4 或 IPv6 代理**.

{% hint style="success" %}
要 **启用此功能**，请联系您的客户经理（详细信息可在 [仪表板](https://dashboard.oxylabs.io/)中查看）。您可能需要完成一个简短的 [KYC](https://oxylabs.io/kyc-and-safety) 流程。
{% endhint %}

### 用法

在用户名字符串中添加 `ipversion` 参数以指定 IP 版本。它可与其他参数一起使用。&#x20;

* `ipversion-4` 从 **IPv4** 池中选择代理
* `ipversion-6` 从 **IPv6** 池中选择代理

例如，如果您只想接收 IPv6 代理，您的用户名字符串应为： `customer-USERNAME-ipversion-6`。以下是完整的 cURL 示例：

```bash
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME-ipversion-6:PASSWORD" https://ip.oxylabs.io/location
```

{% hint style="warning" %}
住宅代理是动态的，因此在将 IP 版本与特定位置（例如城市、邮编）结合使用时，我们无法保证可用性。
{% endhint %}

如果目标网站不支持某个 IP 版本，我们的系统将在可能的情况下解析为受支持的 IP 版本。例如，如果您对仅支持 IPv6 的参数在仅支持 IPv4 的网站上使用，该代理可能会自动改为使用 IPv4 来解析目标。

{% hint style="info" %}
请联系您的客户经理以 **跳过自动解析** 并将 IP 版本限制为所选版本。
{% endhint %}

### 错误处理

如果目标网站不支持 IPv6 且您已禁用自动解析，您将收到一个 `522` 错误代码。在这种情况下，请为该特定网站切换到 IPv4 或完全删除 `ipversion` 参数。


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.oxylabs.io/documentation/cn/dai-li/residential-proxies/advanced-filters/ip-version.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
