location retrieves information from the location database. This data can be used to determine someone’s location on the Internet and for building firewall rulesets to block access from certain ASes or countries.


No installation is needed. location is part of the core package.


To run location with help just enter the command:

[root@ipfire ~] # location -h
usage: location [-h] [--debug] [--quiet] [--version] [--database DATABASE] [--public-key PUBLIC_KEY]

Location Database Command Line Interface

positional arguments:
    version             Show database version
    lookup              Lookup one or multiple IP addresses
    dump                Dump the entire database
    update              Update database
    verify              Verify the downloaded database
    get-as              Get information about one or multiple Autonomous Systems
    search-as           Search for Autonomous Systems that match the string
                        Lists all networks in an AS
                        Lists all networks in a country
                        Lists all networks with flags
    list-bogons         Lists all bogons
    list-countries      Lists all countries
    export              Exports data in many formats to load it into packet filters

  -h, --help            show this help message and exit
  --debug               Enable debug output
  --quiet               Enable quiet mode
  --version             show program's version number and exit
  --database DATABASE, -d DATABASE
                        Path to database
  --public-key PUBLIC_KEY, -k PUBLIC_KEY
                        Public Signing Key