4 location - Query the location database
8 `location lookup ADDRESS [ADDRESS...]`
9 `location get-as ASN [ASN...]`
10 `location search-as STRING`
13 `location list-networks-by-as ASN`
14 `location list-networks-by-cc COUNTRY_CODE`
15 `location list-networks-by-flags [--anonymous-proxy|--satellite-provider|--anycast]`
16 `location list-countries [--show-name] [--show-continent]`
19 `location` retrieves information from the location database.
20 This data can be used to determine someone's location on the Internet
21 and for building firewall rulesets to block access from certain ASes
28 The path of the database which is being opened.
30 If this option is omitted, the system's database will be opened.
40 'lookup ADDRESS [ADDRESS...]'::
41 This command returns the network the given IP address has been found in
42 as well as its Autonomous System if that information is available.
44 'get-as ASN [ASN...]'::
45 This command returns the name of the owning organisation of the Autonomous
49 Lists all Autonomous Systems which match the given string.
51 The search will be performed case-insensitively.
54 This command will try to update the local database.
56 It will terminate with a return code of zero if the database has been
57 successfully updated. 1 on error, 2 on invalid call and 3 if the
58 database was already the latest version.
61 Verifies the downloaded database.
63 'list-networks-by-as [--family=[ipv6|ipv4]] [--output-format FORMAT] ASN'::
64 Lists all networks which belong to this Autonomous System.
66 The '--family' parameter can be used to filter output to only IPv6 or
69 The '--output-format' parameter can change the output so that it can be
70 directly loaded into other software. The following options are available:
72 * 'list' (default): Just lists all networks, one per line
74 * 'nftables': For nftables
75 * 'xt_geoip': Returns a list of networks to be loaded into the xt_geoip
78 'list-networks-by-cc [--family=[ipv6|ipv4]] [--output-format FORMAT] COUNTRY_CODE'::
79 Lists all networks that belong to a country.
81 The country has to be encoded in ISO3166 Alpha-2 notation.
83 See above for usage of the '--family' and '--output-format' parameters.
85 'list-networks-by-flags [--family=[ipv6|ipv4]] [--output-format FORMAT] [--anonymous-proxy|--satellite-provider|--anycast]'::
86 Lists all networks that have a certain flag.
88 See above for usage of the '--family' and '--output-format' parameters.
90 'list-countries [--show-name] [--show-continent]'::
91 Lists all countries known to the database.
93 With the optional parameters '--show-name' and '--show-continent', the name and
94 continent code will be printed, too.
97 Shows a short help text on using this program.
100 Shows the program's version and exists.
103 The 'location' command will normally exit with code zero.
104 If there has been a problem and the requested action could not be performed,
105 the exit code is unequal to zero.
108 The downloader checks a DNS record for the latest version of the database.
109 It will then try to download a file with that version from a mirror server.
110 If the downloaded file is outdated, the next mirror will be tried until we
111 have found a file that is recent enough.
114 Please report all bugs to the bugtracker at https://bugzilla.ipfire.org/.