]> git.ipfire.org Git - location/libloc.git/blame - man/location-query.txt
location-query: Add listing networks by flags
[location/libloc.git] / man / location-query.txt
CommitLineData
161ac92d
MT
1= location-query(8)
2
3== NAME
4location-query - Query the location database
5
6== SYNOPSIS
7[verse]
8`location-query lookup ADDRESS [ADDRESS...]`
9`location-query get-as ASN [ASN...]`
10`location-query search-as STRING`
11`location-query list-networks-by-as ASN`
12`location-query list-networks-by-cc COUNTRY_CODE`
bbdb2e0a 13`location-query list-networks-by-flags [--anonymous-proxy|--satellite-provider|--anycast]`
161ac92d
MT
14
15== DESCRIPTION
16The `location-query` retrieves information from the location database.
17This data can be used to determine someone's location on the Internet
18and for building firewall rulesets to block access from certain ASes
19or countries.
20
21== OPTIONS
22
23--database FILE::
24-d FILE::
25 The path of the database which is being opened.
26 +
27 If this option is omitted, the system's database will be opened.
28
29--debug::
30 Enable debugging mode
31
32== COMMANDS
33
34'lookup ADDRESS [ADDRESS...]'::
35 This command returns the network the given IP address has been found in
36 as well as its Autonomous System if that information is available.
37
38'get-as ASN [ASN...]'::
39 This command returns the name of the owning organisation of the Autonomous
40 System.
41
42'search-as STRING'::
43 Lists all Autonomous Systems which match the given string.
44 +
45 The search will be performed case-insensitively.
46
4439e317 47'list-networks-by-as [--output-format FORMAT] ASN'::
161ac92d 48 Lists all networks which belong to this Autonomous System.
4439e317
MT
49 +
50 The '--output-format' parameter can change the output so that it can be
51 directly loaded into other software. The following options are available:
52 +
53 * 'list' (default): Just lists all networks, one per line
6da14cc1 54 * 'ipset': For ipset
71e0ad0b 55 * 'nftables': For nftables
4439e317
MT
56 * 'xt_geoip': Returns a list of networks to be loaded into the xt_geoip
57 kernel module
161ac92d 58
4439e317 59'list-networks-by-cc [--output-format FORMAT] COUNTRY_CODE'::
161ac92d
MT
60 Lists all networks that belong to a country.
61 +
62 The country has to be encoded in ISO3166 Alpha-2 notation.
4439e317
MT
63 +
64 See above for usage of the '--output-format' parameter.
161ac92d 65
bbdb2e0a
MT
66'list-networks-by-flags [--output-format FORMAT] [--anonymous-proxy|--satellite-provider|--anycast]'::
67 Lists all networks that have a certain flag.
68 +
69 See above for usage of the '--output-format' parameter.
70
161ac92d
MT
71'--help'::
72 Shows a short help text on using this program.
73
74'--version'::
75 Shows the program's version and exists.
76
77== EXIT CODES
78The 'location-query' command will normally exit with code zero.
79If there has been a problem and the requested action could not be performed,
80the exit code is unequal to zero.
81
82== BUGS
83Please report all bugs to the bugtracker at https://bugzilla.ipfire.org/.
84
85== AUTHORS
86Michael Tremer