Disclosure up front: I run IPYE, a company that leases IP space. This is a practical how-to, and IPYE comes up where it helps, with a short call to action at the end.
Many sites change their content by visitor location: local currencies, regional catalogs, search results, store availability, legal notices. If you collect this data, the location sites assign to your addresses decides what you see. A US range mislocated to Germany returns the wrong results without any error. This guide covers how to choose, check and maintain the location of ranges used for regional data collection, with IPYE's US and European locations as examples. The examples use the documentation prefixes 198.51.100.0/24 (US) and 203.0.113.0/24 (EU).
How sites decide where you are
Most sites look up the client IP in a commercial geolocation database, sometimes several. They may also use:
- Accept-Language and timezone signals from the client.
- Cookies or account settings.
- URL or country selectors.
The IP lookup is usually the default, and the others override it. For honest regional collection, make all of them consistent: a US address, en-US language and the US version of the site.
Choose the region that matches the target
- For US regional content, use a US range. East or West Coast can matter for sites that localise by state or metro, such as store availability or delivery estimates.
- For the UK, use London. For continental Europe, Amsterdam or Frankfurt, depending on which country's results you need. Sites often treat an IP in the Netherlands differently from one in Germany.
Lease ranges in each region you need, rather than relying on one range and hoping databases place it where you want.
Check where databases place your range
Before production use, look up several addresses from each range in the main geolocation databases, using their free lookup pages. Note the country, region and city.
Then check what target sites actually do. Fetch a page known to show the location, such as a store locator or a currency display, from each range:
curl --interface 198.51.100.10 -s https://www.example-shop.test/ | grep -o 'currency":"[A-Z]*' Publish a geofeed
Tell databases where your ranges are, using an RFC 8805 geofeed:
198.51.100.0/24,US,US-CA,Los Angeles, 203.0.113.0/24,DE,DE-HE,Frankfurt am Main, Serve it over HTTPS, ask your provider to reference it from the RIR record (RFC 9632), and submit corrections to the major databases. Updates take days to weeks, and longer to reach the sites that license the data.
Keep each range in one place
Announcing one range from several regions confuses geolocation. Keep each /24 announced from one location. If you move it, update the geofeed the same day, and re-submit corrections.
Match the rest of the request
- Set
Accept-Languageto the target locale. - Use the site's regional domain or path where it has one.
- If you use a headless browser, set its timezone and locale to match the IP's region.
An address in London sending Accept-Language: ja-JP from a browser set to Pacific time is inconsistent, and some sites treat that as suspicious.
Validate continuously
Locations drift when databases update. Add a daily check per range: fetch a known geo-indicator page and compare the result with the expected region. Alert on changes.
Getting ranges in the regions you need
You can lease /24s from IPYE in each location listed above, and region changes apply automatically. Each lease includes a LOA, a ROA and reverse DNS.
Next step
List the regions your data needs, set up a range in each through the IPYE portal, and publish a geofeed before you start collecting.
About IPYE
IPYE leases IPv4, IPv6 and ASN space with instant setup. Your first IPv6 /48 is free for the first year, a real allocation you can announce on your own ASN, with a LOA from the portal and the ROA created automatically. IPv4 /24 to /22 leases include LOA, ROA and per-/24 rDNS, and ASN and region changes apply automatically. Locations: Los Angeles, New York, Ashburn, Salt Lake City, London, Amsterdam, Frankfurt. More at ipye.com. Questions: ipye@turnel.com.
Disclosure: I run IPYE
