LOCATION(1)
π
LOCATION(1) β the location page, but make it make sense
okay bestie, sit down, because this one is genuinely iconic. the manual name is location and it's a little command-line bestie for talking to the location database πΊοΈβ¨
β¨ SYNOPSIS β¨
location export --directory=DIR [--format=FORMAT] [--family=ipv6|ipv4] [ASN|CC ...]
location get-as ASN [ASN...]
location list-countries [--show-name] [--show-continent]
location list-networks-by-as ASN
location list-networks-by-cc COUNTRY_CODE
location list-networks-by-flags [--anonymous-proxy|--satellite-provider|--anycast|--drop]
location lookup ADDRESS [ADDRESS...]
location search-as STRING
location update [--cron=daily|weekly|monthly]
location verify
location version
like, that's the whole vibe in one code block π
π¦ DESCRIPTION π¦
so location goes and retrieves information from the location database. that data is lowkey powerful: you can use it to figure out where someone is on the Internet π, and you can use it to build firewall rulesets that block access from certain ASes or countries. main character firewall energy, no cap π₯
π OPTIONS π
--database FILE,-d FILEβ the path of the database which is being opened. if you omit this option, the system's database will be opened (default behaviour, slay π«Ά).--quietβ enable quiet mode π€«--debugβ enable debugging mode πβ¨
π COMMANDS π
π export [--directory=DIR] [--format=FORMAT] [--family=ipv6|ipv4] [ASN|CC ...]
this command exports the whole database into the given directory π¦
the output can be filtered by only exporting a certain address family, or by passing a list of country codes and/or ASNs. the default is to export all known countries π
the output format can be chosen with the --format parameter. for possible formats, please see below π
if the --directory option is omitted, the output will be written to stdout β which is literally so useful when you want to load any custom exports straight into nftables or ipset π
π get-as ASN [ASN...]
this command returns the name of the owning organisation of the Autonomous System π’
π list-countries [--show-name] [--show-continent]
lists all countries known to the database π
with the optional parameters --show-name and --show-continent, the name and continent code will be printed, too β¨
π list-networks-by-as [--family=[ipv6|ipv4]] [--format=FORMAT] ASN
lists all networks which belong to this Autonomous System πΈοΈ
the --family parameter can be used to filter output to only IPv6 or IPv4 addresses.
the --format parameter can change the output so that it can be directly loaded into other software. for details see below π
π list-networks-by-cc [--family=[ipv6|ipv4]] [--format=FORMAT] COUNTRY_CODE
lists all networks that belong to a country πΎ
the country has to be encoded in ISO3166 Alpha-2 notation β οΈ (so like, the two-letter code, not the whole name, bestie).
see above for usage of the --family and --format parameters.
π list-networks-by-flags [--family=[ipv6|ipv4]] [--format=FORMAT] [--anonymous-proxy|--satellite-provider|--anycast|--drop]
lists all networks that have a certain flag π©
see above for usage of the --family and --format parameters.
π list-bogons [--family=[ipv6|ipv4]] [--format=FORMAT]
lists all bogons (i.e. networks that are unknown to the database) π
see above for usage of the --family and --format parameters.
π lookup ADDRESS [ADDRESS...]
this command returns the network the given IP address has been found in as well as its Autonomous System if that information is available π
π search-as STRING
lists all Autonomous Systems which match the given string π
the search will be performed case-insensitively π (so don't stress about caps, fr fr)
π update
this command will try to update the local database π
it will terminate with a return code of zero if the database has been successfully updated. 1 on error, 2 on invalid call and 3 if the database was already the latest version.
the --cron option allows limiting updates to once a day (daily), once a week (weekly), or once a month (monthly). if the task is being called, but the database has been updated recently, an update will be skipped βοΈ
π verify
verifies the downloaded database β
π version
shows the version information of the downloaded database π·οΈ
π --help
shows a short help text on using this program π
π --version
shows the program's version and exists π (yes, the page really says "exists" β copying it exactly, character for character, don't come for me)
π EXIT CODES π
the location command will normally exit with code zero π if there has been a problem and the requested action could not be performed, the exit code is unequal to zero π
π FORMATS π
some commands allow specifying the output format. this is helpful if the exported data should be imported into a packet filter for example π‘οΈ the following formats are understood:
list(default): just lists all networks, one per line πipset: foripsetπ§Ίnftables: fornftablesπ₯xt_geoip: returns a list of networks to be loaded into thext_geoipkernel module π§
π§ HOW IT WORKS π§
the downloader checks a DNS record for the latest version of the database π΅οΈ then it will try to download a file with that version from a mirror server. if the downloaded file is outdated, the next mirror will be tried until we have found a file that is recent enough πβ¨
π BUG REPORTS π
please report all bugs to the bugtracker at https://bugzilla.ipfire.org/; refer to https://wiki.ipfire.org/devel/bugzilla for details ππ«Ά
π AUTHORS π
Michael Tremer π
ok that's the whole page, nothing skipped, every flag present and accounted for π
and yeah β that's LOCATION(1) from the LOCATION manual, version... well, the footer just says LOCATION(1) again, so consider this your cute sign-off: page LOCATION(1), manual LOCATION(1), and the date on this footer is... also just the manual name, iconic of it honestly ππ go forth and block some ASes bestie π
π¦ where this page comes from
- ubuntu stonking: location 0.9.19-1build1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms