geo

geo estimates the location and network ownership of a public IP through a remote provider or, when available, a local GeoIP database.

NetworkVersion 1.2.4Stable
lil-terminal

Overview

Use geo for IP geolocation and network ownership. Common operations stay short; specialized forms add detail only when needed, so repeated work remains easy to understand, repeat and place in lil-terminal scripts.

IP geolocation is context, not identity

Public IP geolocation can be shifted by VPNs, proxies, mobile networks, CDNs and provider routing. -local avoids the remote lookup, but only works when the hosting environment provides a compatible GeoIP extension and database.

Syntax

lil-terminal
geo [host|ip|me] [options]

Reference

geo

show provider and local GeoIP status

geo me

use the current visitor address

geo -c

show country and continent for the current visitor

geo 8.8.8.8

show a brief IP location and network summary

geo example.com -a

show all available location and network fields

geo -db

show local GeoIP database details

-c

show country and continent

-r

show region, city, postal code and coordinates

-tz

show timezone details

-asn | -isp | -org | -dom

show selected network details

-type

show the IP family

-json

show the provider response as formatted JSON

-4 | -6

resolve a hostname through IPv4 or IPv6

-local

use the local GeoIP extension only

Practical workflow

Run geo to check available data sources, geo me for the current visitor IP, or geo 8.8.8.8 for a brief report. Use -c for country, -r for region and approximate coordinates, -tz for time zone, or -asn/-isp/-org/-dom for network ownership. -json shows the provider’s returned data; -a requests all supported fields. -4/-6 chooses the address family for hostnames; -local avoids remote lookup when a local GeoIP extension is available. -db checks the local database.

Limits and safety

Private and loopback IPs are rejected. Some other special-purpose ranges may pass PHP filtering but still be refused by the geolocation provider. Remote lookups use ipwho.is over HTTPS (with a limited session cache), so avoid querying sensitive addresses without permission. The optional local GeoIP extension may return fewer fields; hosting firewall rules or API outages can block remote lookups. The examples are offline mock responses and deliberately do not claim real locations or contact the provider.

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Check the provider, then inspect an IP

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install geo
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install geo -m
Exact public version

Install exactly this published version.

install geo -v 1.2.4
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade geo
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install geo -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Check the provider, then inspect an IP
geo
Offline educational example — not a live lookup
Remote       ipwho.is
HTTPS        yes
Local GeoIP  no
Show local GeoIP database details
geo -db
Offline educational example — not a live lookup
Local GeoIP database unavailable
Use the current visitor address
geo me
Offline educational example — not a live lookup
IP           8.8.8.8
Source       ipwho.is
Type         IPv4
Continent    Example continent (XX)
Country      Example country (ZZ)
Region       Example region (XX-01)
City         Example city
Postal       00000
Coordinates  0, 0
ASN          AS64500
ISP          Example ISP
ORG          Example Network
Timezone     Etc/UTC (+00:00)
Show a brief IP location and network summary
geo 8.8.8.8
Offline educational example — not a live lookup
IP           8.8.8.8
Source       ipwho.is
Type         IPv4
Continent    Example continent (XX)
Country      Example country (ZZ)
Region       Example region (XX-01)
City         Example city
Postal       00000
Coordinates  0, 0
ASN          AS64500
ISP          Example ISP
ORG          Example Network
Timezone     Etc/UTC (+00:00)
Show all available location and network fields
geo 8.8.8.8 -a
Offline educational example — not a live lookup
IP           8.8.8.8
Source       ipwho.is
Type         IPv4
Continent    Example continent (XX)
Country      Example country (ZZ)
Region       Example region (XX-01)
City         Example city
Postal       00000
Coordinates  0, 0
ASN          AS64500
ISP          Example ISP
ORG          Example Network
Domain       example.test
Timezone     Etc/UTC (+00:00)
Local time   2026-11-01T12:00:00Z
Show country and continent for the current visitor
geo -c
Offline educational example — not a live lookup
IP         8.8.8.8
Source     ipwho.is
Continent  Example continent (XX)
Country    Example country (ZZ)
Show country and continent
geo 8.8.8.8 -c
Offline educational example — not a live lookup
IP         8.8.8.8
Source     ipwho.is
Continent  Example continent (XX)
Country    Example country (ZZ)
Reject an address without public geolocation
geo 8.8.8.8 -r
Offline educational example — not a live lookup
IP           8.8.8.8
Source       ipwho.is
Region       Example region (XX-01)
City         Example city
Postal       00000
Coordinates  0, 0
Show timezone details
geo 8.8.8.8 -tz
Offline educational example — not a live lookup
IP        8.8.8.8
Source    ipwho.is
Timezone  Etc/UTC (+00:00)
Show selected network details
geo 8.8.8.8 -asn
Offline educational example — not a live lookup
IP      8.8.8.8
Source  ipwho.is
ASN     AS64500
Show selected network details
geo 8.8.8.8 -isp
Offline educational example — not a live lookup
IP      8.8.8.8
Source  ipwho.is
ISP     Example ISP
Show selected network details
geo 8.8.8.8 -org
Offline educational example — not a live lookup
IP      8.8.8.8
Source  ipwho.is
ORG     Example Network
Show selected network details
geo 8.8.8.8 -dom
Offline educational example — not a live lookup
IP      8.8.8.8
Source  ipwho.is
Domain  example.test
Show the IP family
geo 8.8.8.8 -type
Offline educational example — not a live lookup
IP      8.8.8.8
Source  ipwho.is
Type    IPv4
Show the provider response as formatted JSON
geo 8.8.8.8 -json
Offline educational example — not a live lookup
{
    "ip": "8.8.8.8",
    "type": "IPv4",
    "continent": "Example continent",
    "continent_code": "XX",
    "country": "Example country",
    "country_code": "ZZ",
    "region": "Example region",
    "region_code": "XX-01",
    "city": "Example city",
    "postal": "00000",
    "latitude": 0,
    "longitude": 0,
    "connection": {
        "asn": 64500,
        "isp": "Example ISP",
        "org": "Example Network",
        "domain": "example.test"
    },
    "timezone": {
        "id": "Etc/UTC",
        "utc": "+00:00",
        "current_time": "2026-11-01T12:00:00Z"
    }
}
Show country and continent
geo 8.8.8.8 -c -r -tz
Offline educational example — not a live lookup
IP           8.8.8.8
Source       ipwho.is
Continent    Example continent (XX)
Country      Example country (ZZ)
Region       Example region (XX-01)
City         Example city
Postal       00000
Coordinates  0, 0
Timezone     Etc/UTC (+00:00)
Use the local GeoIP extension only
geo 8.8.8.8 -local
Offline educational example — not a live lookup
Local GeoIP data unavailable
Resolve a hostname through IPv4 or IPv6
geo example.test -4 -c
Offline educational example — not a live lookup
Target     example.test
IP         8.8.8.8
Source     ipwho.is
Continent  Example continent (XX)
Country    Example country (ZZ)
Resolve a hostname through IPv4 or IPv6
geo example.test -6 -c
Offline educational example — not a live lookup
Target     example.test
IP         2606:4700:4700::1111
Source     ipwho.is
Continent  Example continent (XX)
Country    Example country (ZZ)
Geo · 20
geo 10.0.0.2
Offline educational example — not a live lookup
Public IP address required
Geo · 21
geo 127.0.0.1
Offline educational example — not a live lookup
Public IP address required
Geo · -4
geo 8.8.8.8 -4 -6
Offline educational example — not a live lookup
Choose either IPv4 or IPv6
Geo · -what
geo 8.8.8.8 -what
Offline educational example — not a live lookup
?
Geo · -c
geo bad.invalid -c
Offline educational example — not a live lookup
Host not found

Related documentation

Current public release

v1.2.42026-10-31

GeoIP field filters without a host

A field-only geo request such as geo -c now selects the visitor IP automatically.