--- /dev/null
+= location(8)
+
+== NAME
+location - Query the location database
+
+== SYNOPSIS
+[verse]
+`location lookup ADDRESS [ADDRESS...]`
+`location get-as ASN [ASN...]`
+`location search-as STRING`
+`location update`
+`location verify`
+`location list-networks-by-as ASN`
+`location list-networks-by-cc COUNTRY_CODE`
+`location list-networks-by-flags [--anonymous-proxy|--satellite-provider|--anycast]`
+
+== DESCRIPTION
+`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.
+
+== OPTIONS
+
+--database FILE::
+-d FILE::
+ The path of the database which is being opened.
+ +
+ If this option is omitted, the system's database will be opened.
+
+--quiet::
+ Enable quiet mode
+
+--debug::
+ Enable debugging mode
+
+== COMMANDS
+
+'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.
+
+'get-as ASN [ASN...]'::
+ This command returns the name of the owning organisation of the Autonomous
+ System.
+
+'search-as STRING'::
+ Lists all Autonomous Systems which match the given string.
+ +
+ The search will be performed case-insensitively.
+
+'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.
+
+'verify'::
+ Verifies the downloaded database.
+
+'list-networks-by-as [--family=[ipv6|ipv4]] [--output-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 '--output-format' parameter can change the output so that it can be
+ directly loaded into other software. The following options are available:
+ +
+ * 'list' (default): Just lists all networks, one per line
+ * 'ipset': For ipset
+ * 'nftables': For nftables
+ * 'xt_geoip': Returns a list of networks to be loaded into the xt_geoip
+ kernel module
+
+'list-networks-by-cc [--family=[ipv6|ipv4]] [--output-format FORMAT] COUNTRY_CODE'::
+ Lists all networks that belong to a country.
+ +
+ The country has to be encoded in ISO3166 Alpha-2 notation.
+ +
+ See above for usage of the '--family' and '--output-format' parameters.
+
+'list-networks-by-flags [--family=[ipv6|ipv4]] [--output-format FORMAT] [--anonymous-proxy|--satellite-provider|--anycast]'::
+ Lists all networks that have a certain flag.
+ +
+ See above for usage of the '--family' and '--output-format' parameters.
+
+'--help'::
+ Shows a short help text on using this program.
+
+'--version'::
+ Shows the program's version and exists.
+
+== 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.
+
+== HOW IT WORKS
+The downloader checks a DNS record for the latest version of the database.
+It will then 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.
+
+== BUGS
+Please report all bugs to the bugtracker at https://bugzilla.ipfire.org/.
+
+== AUTHORS
+Michael Tremer