IP rotation is the practice of sending outgoing requests through a pool of IP addresses and switching the source IP on a set rule, such as for each request, each session, or at set intervals. Spreading traffic this way keeps each IP's request volume lower, so per-IP rate limits and bans affect less of the job.
IP rotation is the technique. A rotating proxy is a service that does it for you behind one gateway address, but you can also rotate IPs in your own code. Home connections with dynamic IPs can change address too, but on the network's schedule, not yours.
How IP Rotation Works
- Get a pool: a list of proxy IPs, or a gateway in front of a provider's proxy pool.
- Pick an IP by rule: choose an address for the next request or session.
- Send the request through it: the target site sees only the chosen IP.
- Rest or drop failing IPs: take an IP out of use when it starts getting block responses, such as 403 or 429.
Rotation Rules
- Per request: a new IP for each request. Reused connections can keep the same IP, as explained under rotating proxy.
- Timed: the IP changes at a fixed interval, such as every few minutes.
- Per session (sticky): one IP is held for a session and then replaced. See sticky session.
- On failure: the IP changes only after a block or rate-limit response.
- Order: round-robin uses each IP in turn; random selection picks any available IP.
Ways to Rotate IPs
| Rotating proxy gateway | Rotation in your own code | Switching VPN servers | |
|---|---|---|---|
| Who picks the IP | The provider's gateway | Your script, from a list of proxies | You or the VPN app |
| How you connect | One host and port | A different proxy per request or session | One tunnel for the whole device |
| Different IPs at once | Yes, per connection or session | Yes, per request | No, one server per connection |
In code, rotation means setting the proxy on each request. Scrapy, for example, reads it from request.meta['proxy']. For how VPNs differ from proxies, see VPN vs. proxy.
Rotating Within One Subnet Isn't Real Rotation
Sites don't only count single addresses, so a pool of neighboring IPs can act like one IP:
- Ranges: nginx's
denydirective accepts a CIDR range, so one rule can block a whole subnet, such as the 256 addresses in a /24. - Networks: Cloudflare's rate limiting rules can count requests by AS number, so every IP from the same network adds to one counter. See ASN.
- IPv6 prefixes: RFC 6177 says end sites should get at least one /64, and in most cases much more. A site can treat a whole prefix as one user, so rotating addresses inside it changes little.
What matters is how many different ranges and networks a pool spans, not just how many IPs it holds.
What It Means for Web Scraping
- Rotation doesn't replace pacing: when a site answers 429, wait for the time in its Retry-After header instead of retrying at once from a new IP.
- Cookies can outlast the IP: Cloudflare's "IP with NAT support" option can identify visitors by a session cookie (
_cfuvid), so a new IP with the same cookie jar may still count as the same visitor. - Match the rule to the task: rotate per request for independent pages and hold one IP for logins and checkouts.
Why Rotation Alone Isn't Enough
A new IP doesn't change everything else a site can see. Sites can link requests through a browser fingerprint built from signals such as the User-Agent header, window size, installed fonts and how graphics render. A fingerprint can identify a client even when its IP is hidden or cookies are blocked.