> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/products/proxies/residential-proxies/whitelisting-ips.md).

# IP Whitelisting & Auth

Learn how to create or edit an IP whitelist for your Residential Proxies.

IP whitelisting allows you to access Oxylabs Residential Proxies using your personal whitelisted IPs to bypass username and password requirement in your proxy request.

{% hint style="warning" %}
**Do not mix authentication methods.** If your source IP is whitelisted, connect using either IP authentication or credential authentication and never both simultaneously. Passing credentials from a whitelisted IP can cause unexpected routing behavior or browser `407 Proxy Authentication Required` errors.
{% endhint %}

## Create an IP whitelist

To enable IP-based authentication, register your server's static public IPv4 address in the Oxylabs Dashboard.

1. Log in to the [**Oxylabs Dashboard**](https://dashboard.oxylabs.io/).
2. Create a Residential Proxy product instance.
3. In the **Authentication setting** select **Whitelisted IPs**.

   <figure><img src="https://3826932121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBQ7Zf9paoN3FTeGcyfY1%2Fuploads%2FQ2n1AyQHRvSd6CgAJsPE%2FScreenshot%202026-10-05%20at%2004.17.12.png?alt=media&amp;token=0799c543-bb9a-495e-a6b7-d842b6c19fa9" alt=""><figcaption></figcaption></figure>
4. Enter **up to 10 public IPv4** addresses (in `xx.xx.xx.xx` format).
5. Fill in all necessary details and click **Create instance**.

{% hint style="warning" %}

* Make sure you are not connected to a VPN or local proxy service when checking your public IP address.
* If your team shares a public IP address or requires individual sub-user tracking, use credential authentication instead of IP whitelisting.
  {% endhint %}

## Requests with whitelisted IPs

When using IP Whitelisting, parameters (such as [location](/products/proxies/residential-proxies/location-settings.md), [session IDs](/products/proxies/residential-proxies/session-control.md), or ASNs) cannot be embedded into a username string. Instead, all proxy flags are added directly to the entry node host address as a subdomain pointing to `.bc.pr.oxylabs.io:7777`.

```
cc-us-city-new_york-sessid-test123.bc.pr.oxylabs.io:7777
```

<table><thead><tr><th width="149">Type</th><th width="119">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><a href="/products/proxies/residential-proxies/location-settings.md#country"><strong>Country targeting</strong></a></td><td><code>cc</code></td><td>2-letter ISO country code.<br>E.g. <code>cc-de.bc.pr.oxylabs.io:7777</code></td></tr><tr><td><a href="/products/proxies/residential-proxies/location-settings.md#city"><strong>City targeting</strong></a></td><td><code>city</code></td><td>Requires <code>cc</code> parameter. Spaces use <code>_</code>.<br>E.g. <code>cc-us-city-new_york.bc.pr.oxylabs.io:7777</code></td></tr><tr><td><a href="/products/proxies/residential-proxies/location-settings.md#state"><strong>State targeting</strong></a></td><td><code>st</code></td><td>US states; requires <code>us_</code> prefix.<br>E.g. <code>st-us_california.bc.pr.oxylabs.io:7777</code></td></tr><tr><td><a href="/products/proxies/residential-proxies/location-settings.md#continent"><strong>Continent targeting</strong></a></td><td><code>cn</code></td><td>2-letter continent code (<code>AF</code>, <code>AN</code>, <code>AS</code>, <code>EU</code>, <code>NA</code>, <code>OC</code>, <code>SA</code>).<br>E.g. <code>cn-eu.bc.pr.oxylabs.io:7777</code></td></tr><tr><td><a href="/products/proxies/residential-proxies/location-settings.md#zip-postal-code"><strong>ZIP / Postal code targeting</strong></a></td><td><code>postalcode</code></td><td>5-digit US ZIP code; requires <code>cc-us</code>.<br>E.g. <code>cc-us-postalcode-90210.bc.pr.oxylabs.io:7777</code></td></tr><tr><td><a href="/products/proxies/residential-proxies/location-settings.md#geo-hash"><strong>Geo hash targeting</strong></a></td><td><code>geohash</code></td><td>Grid cell levels 1 to 4 (<code>9</code> to <code>drq4</code>).<br>E.g. <code>geohash-u09.bc.pr.oxylabs.io:7777</code></td></tr><tr><td><a href="/products/proxies/residential-proxies/location-settings.md#asn-targeting"><strong>ASN tageting</strong></a></td><td><code>ASN</code></td><td>Target specific Autonomous System Numbers.<br>E.g. <code>asn-21928.bc.pr.oxylabs.io:7777</code></td></tr><tr><td><a href="/products/proxies/residential-proxies/session-control.md#default-sticky-sessions-sessid"><strong>Sticky session</strong></a></td><td><code>sessid</code></td><td>Binds sequential requests to the same IP (10-min default).<br>E.g. <code>sessid-test123.bc.pr.oxylabs.io:7777</code></td></tr><tr><td><a href="/products/proxies/residential-proxies/session-control.md#extend-session-duration-sesstime"><strong>Session duration</strong></a></td><td><code>sesstime</code></td><td>Extends session duration in minutes.<br>E.g. <code>sessid-test123-sesstime-15.bc.pr.oxylabs.io:7777</code></td></tr></tbody></table>

#### Code examples

{% tabs %}
{% tab title="cURL" %}

```shell
curl -x https://cc-us-city-new_york-sessid-test123.bc.pr.oxylabs.io:7777 https://ip.oxylabs.io/location
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$session_id = 'test123';  // Your session ID
$city = 'new_york';  // The city you want to target
$proxy = "cc-us-city-$city-sessid-$session_id.bc.pr.oxylabs.io:7777";
$query = curl_init('https://ip.oxylabs.io/location');

curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($query, CURLOPT_PROXY, "http://$proxy");
$output = curl_exec($query);
curl_close($query);

if ($output)
    echo $output;
?>

```

{% endtab %}

{% tab title="Python" %}

```python
import urllib.request

session_id = 'test123'  # Your session ID
city = 'new_york'  # The city you want to target
proxy = 'cc-us-city-%s-sessid-%s.bc.pr.oxylabs.io:7777' % (city, session_id)

query = urllib.request.ProxyHandler({
    'http': proxy,
    'https': proxy,
})

execute = urllib.request.build_opener(query)
print(execute.open('https://ip.oxylabs.io/location').read())

```

{% endtab %}

{% tab title="Java" %}

```java
package example;

import org.apache.http.HttpHost;
import org.apache.http.client.fluent.*;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpHost entry = new HttpHost("cc-us-city-new_york-sessid-test123.bc.pr.oxylabs.io", 7777);

        String query = Executor.newInstance()
            .execute(Request.Get("http://ip.oxylabs.io/location").viaProxy(entry))
            .returnContent().asString();
        
        System.out.println(query);
    }
}

```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Net;

class Example
{
    static void Main()
    {
        var client = new WebClient();
        
        client.Proxy = new WebProxy("cc-us-city-new_york-sessid-test123.bc.pr.oxylabs.io:7777");

        Console.WriteLine(client.DownloadString("https://ip.oxylabs.io/location"));
    }
}

```

{% endtab %}

{% tab title="Go" %}

```ruby
package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"net/url"
)

func main() {
	proxyURL, _ := url.Parse("https://cc-us-city-new_york-sessid-test123.bc.pr.oxylabs.io:7777")
	client := &http.Client{Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)}}

	resp, err := client.Get("https://ip.oxylabs.io/location")
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	defer resp.Body.Close()

	body, _ := ioutil.ReadAll(resp.Body)
	fmt.Println(string(body))
}
```

{% endtab %}
{% endtabs %}


---

# 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://developers.oxylabs.io/products/proxies/residential-proxies/whitelisting-ips.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.
