---
title: "How to rotate a proxy's IP with a change-IP link"
description: "Save your provider's change-IP link on a Donut Browser proxy, get a new IP with one click or one API call, and confirm the new exit before you go on."
url: "https://donutbrowser.com/docs/guides/rotate-proxy-ip/"
---

# How to rotate a proxy's IP with a change-IP link

Mobile and some residential proxy providers give each proxy a change-IP link (also called a rotation link). Opening the link makes the provider give the proxy a new exit IP. Donut Browser stores the link on the proxy, calls it when you click **Change IP**, and exposes the same action in its API, so a script can rotate between tasks. You need a proxy in Donut and its change-IP link from your provider's dashboard.

## 1. Add the link to the proxy

1. Open **Network** (**Cmd/Ctrl+Shift+N**) → **Proxies**.
2. Open the proxy with **Edit proxy**, or create one with **New proxy**.
3. Paste the link into **Change IP link** and save.

The link must be a full `http://` or `https://` address of at most 2,048 characters. Otherwise the form shows "The change IP link must be a full http:// or https:// URL."

## 2. Note the current IP

Click the check button in the proxy's **Status** column. **Connection details** shows the exit IP and its location. Keep it, so you can see the change in step 4.

## 3. Change the IP

Click **Change IP**. The button is in three places:

- on the proxy's row in the **Proxies** table (only when the proxy has a link),
- in the action bar when you select several proxies,
- in the **Network** section of a profile panel that uses the proxy.

Donut sends a `GET` request to the link and waits up to 30 seconds. Any `2xx` answer counts as success, and the toast reads "New IP requested for" and the proxy name. For several proxies, Donut sends up to 4 requests at once and reports each result on its own.

The request goes from your computer to the provider directly, not through the proxy. If you set **Proxy for Donut** in **Settings** → **Network**, or a system proxy, the request goes through that one.

## 4. Confirm the new IP

A `2xx` answer means the provider accepted the request. Donut does not measure the new exit, and some providers take a few seconds to switch. Click the check button again and compare the IP with step 2.

Every profile that uses the proxy reaches the internet through the new IP. Donut does not restart running profiles. A site that you have open can see the IP change in the middle of a session. Rotate between tasks, and never during a login.

If the new IP is in another city or country, the profile's timezone may no longer match it. At the next launch, Donut compares the two and can block the launch. See [How to match a browser's timezone and language to its proxy](https://donutbrowser.com/docs/guides/match-timezone-to-proxy).

## Rotate from a script

`POST /v1/proxies/{id}/rotate` calls the stored link. It works on every plan and needs the [local API](https://donutbrowser.com/docs/quickstart) token in `DONUT_API_KEY`. Find the proxy ID with `GET /v1/proxies`.

```bash
curl -sS -X POST http://127.0.0.1:10108/v1/proxies/<proxy id>/rotate \
  -H "Authorization: Bearer $DONUT_API_KEY"
# {"proxy_id":"…","elapsed_ms":812,"status":200,"error":null}
```

```javascript
const res = await fetch(
  `http://127.0.0.1:10108/v1/proxies/${proxyId}/rotate`,
  {
    method: "POST",
    headers: { Authorization: `Bearer ${process.env.DONUT_API_KEY}` },
  },
);
const result = await res.json();
if (!res.ok) throw new Error(`rotate failed: ${res.status} ${JSON.stringify(result)}`);
console.log(`provider answered ${result.status} in ${result.elapsed_ms} ms`);
```

```python
import os, requests

response = requests.post(
    f"http://127.0.0.1:10108/v1/proxies/{proxy_id}/rotate",
    headers={"Authorization": f"Bearer {os.environ['DONUT_API_KEY']}"},
    timeout=40,
)
print(response.status_code, response.json())
```

| Field | Meaning |
| --- | --- |
| `proxy_id` | The proxy you rotated |
| `elapsed_ms` | How long the provider took to answer |
| `status` | The provider's HTTP status, when it answered |
| `error` | A coded error when the change was not confirmed, else `null` |

To set or change the link from a script, send `rotation_url` with `POST /v1/proxies` or `PUT /v1/proxies/{id}`. In `PUT`, an empty string removes the link, and leaving the field out keeps it. See [Change a proxy's IP](https://donutbrowser.com/docs/rest-api#rotate-proxy) in the API reference.

### Rotate on a timer

Donut has no automatic rotation. To rotate every 10 minutes, run the API call from a scheduler while the app is open. On macOS or Linux, with cron:

```bash
# crontab -e
*/10 * * * * curl -sS -X POST http://127.0.0.1:10108/v1/proxies/<proxy id>/rotate -H "Authorization: Bearer <token>" >/dev/null
```

Cron does not read your shell profile, so the line holds the token. Keep the crontab private. On Windows, Task Scheduler can run the same request with `Invoke-RestMethod`.

## Troubleshooting

| Message | Status | What to do |
| --- | --- | --- |
| "This proxy has no change IP link. Add one when you edit the proxy." | `400` | Add the link in step 1. |
| "The provider refused the IP change (HTTP N)." | `502` | The provider answered with an error. Some providers limit how often a proxy can rotate. Wait, or check the link in their dashboard. |
| "The provider did not answer the IP change within 30 seconds." | `502` | Try again later. |
| "Donut could not reach the provider's change IP link." | `502` | The host in the link does not answer from your computer. Open the link in a normal browser to test it. |
| "Donut could not connect through the system proxy …" | `502` | Your system proxy is down. Fix it or turn it off in the system network settings. |
| "None of these proxies has a change IP link. Add one when you edit a proxy." | | You selected proxies without a link. |

If the check in step 4 shows the old IP, the provider accepted the request but has not switched yet, or gave the same IP back. Wait a few seconds and check again.

## Related

- [Proxies, VPNs and DNS](https://donutbrowser.com/docs/proxies#change-the-ip): proxy settings in the app.
- [How to use a SOCKS5 proxy with a username and password](https://donutbrowser.com/docs/guides/socks5-proxy-with-password)
- [How to create many browser profiles, each with its own proxy](https://donutbrowser.com/docs/guides/bulk-create-profiles)

Change IP and the rotate API are part of the free plan. [Download Donut Browser](https://donutbrowser.com/) for macOS, Windows or Linux.
