4 location-query - Query the location database
8 `location-query lookup ADDRESS [ADDRESS...]`
9 `location-query get-as ASN [ASN...]`
10 `location-query search-as STRING`
11 `location-query update`
12 `location-query verify`
13 `location-query list-networks-by-as ASN`
14 `location-query list-networks-by-cc COUNTRY_CODE`
15 `location-query list-networks-by-flags [--anonymous-proxy|--satellite-provider|--anycast]`
18 The `location-query` retrieves information from the location database.
19 This data can be used to determine someone's location on the Internet
20 and for building firewall rulesets to block access from certain ASes
27 The path of the database which is being opened.
29 If this option is omitted, the system's database will be opened.
39 'lookup ADDRESS [ADDRESS...]'::
40 This command returns the network the given IP address has been found in
41 as well as its Autonomous System if that information is available.
43 'get-as ASN [ASN...]'::
44 This command returns the name of the owning organisation of the Autonomous
48 Lists all Autonomous Systems which match the given string.
50 The search will be performed case-insensitively.
53 This command will try to update the local database.
55 It will terminate with a return code of zero if the database has been
56 successfully updated. 1 on error, 2 on invalid call and 3 if the
57 database was already the latest version.
60 Verifies the downloaded database.
62 'list-networks-by-as [--family=[ipv6|ipv4]] [--output-format FORMAT] ASN'::
63 Lists all networks which belong to this Autonomous System.
65 The '--family' parameter can be used to filter output to only IPv6 or
68 The '--output-format' parameter can change the output so that it can be
69 directly loaded into other software. The following options are available:
71 * 'list' (default): Just lists all networks, one per line
73 * 'nftables': For nftables
74 * 'xt_geoip': Returns a list of networks to be loaded into the xt_geoip
77 'list-networks-by-cc [--family=[ipv6|ipv4]] [--output-format FORMAT] COUNTRY_CODE'::
78 Lists all networks that belong to a country.
80 The country has to be encoded in ISO3166 Alpha-2 notation.
82 See above for usage of the '--family' and '--output-format' parameters.
84 'list-networks-by-flags [--family=[ipv6|ipv4]] [--output-format FORMAT] [--anonymous-proxy|--satellite-provider|--anycast]'::
85 Lists all networks that have a certain flag.
87 See above for usage of the '--family' and '--output-format' parameters.
90 Shows a short help text on using this program.
93 Shows the program's version and exists.
96 The 'location-query' command will normally exit with code zero.
97 If there has been a problem and the requested action could not be performed,
98 the exit code is unequal to zero.
101 The downloader checks a DNS record for the latest version of the database.
102 It will then try to download a file with that version from a mirror server.
103 If the downloaded file is outdated, the next mirror will be tried until we
104 have found a file that is recent enough.
107 Please report all bugs to the bugtracker at https://bugzilla.ipfire.org/.