Geolocation

All geographic data presented through these variables is associated with a particular IP address. This address is automatically populated from client.ip by default, but may be overridden explicitly by setting client.geo.ip_override.

Geographic variables representing names are available in several encodings. Note in particular the *.ascii variables are lossy. These variables have diacritics removed and are normalized to lower case spellings. These *.ascii variables are intended for ease of use as a symbolic string in code (for example, to perform some different action depending on the city name), and are generally inappropriate for presenting to users due to their simplified content.

Absent data

The Geolocation data is updated periodically, as IP allocations change and various amendments are made. Some variables may be absent for the current data at any given time.

For STRING types, the special value ? is used to indicate absent data. These may be normalized to VCL empty strings using the if() ternary operator:

log if (client.as.name == "?", client.as.name, "");

In general strings in VCL may be not set (see the VCL documentation for types). This should never occur for the Geolocation variables.

Reserved IP address blocks

The IPv4 and IPv6 address spaces have several blocks reserved for special uses; these include private use networks (e.g. 192.168.0.0/16), loopback (127.0.0.1/8), and address ranges reserved for documentation (e.g. 203.0.113.0/24 RFC 5737 TEST-NET-3).

Geographic data has no meaningful association for these ranges, and so the Geolocation VCL variables present special values for these ranges instead. These values are: