]> git.ipfire.org Git - people/ms/libloc.git/blob - man/location-query.txt
7a9818099b6697c00015827570b9fcb691405bd7
[people/ms/libloc.git] / man / location-query.txt
1 = location-query(8)
2
3 == NAME
4 location-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`
13 `location-query list-networks-by-flags [--anonymous-proxy|--satellite-provider|--anycast]`
14
15 == DESCRIPTION
16 The `location-query` retrieves information from the location database.
17 This data can be used to determine someone's location on the Internet
18 and for building firewall rulesets to block access from certain ASes
19 or 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
47 'list-networks-by-as [--family=[ipv6|ipv4]] [--output-format FORMAT] ASN'::
48 Lists all networks which belong to this Autonomous System.
49 +
50 The '--family' parameter can be used to filter output to only IPv6 or
51 IPv4 addresses.
52 +
53 The '--output-format' parameter can change the output so that it can be
54 directly loaded into other software. The following options are available:
55 +
56 * 'list' (default): Just lists all networks, one per line
57 * 'ipset': For ipset
58 * 'nftables': For nftables
59 * 'xt_geoip': Returns a list of networks to be loaded into the xt_geoip
60 kernel module
61
62 'list-networks-by-cc [--family=[ipv6|ipv4]] [--output-format FORMAT] COUNTRY_CODE'::
63 Lists all networks that belong to a country.
64 +
65 The country has to be encoded in ISO3166 Alpha-2 notation.
66 +
67 See above for usage of the '--family' and '--output-format' parameters.
68
69 'list-networks-by-flags [--family=[ipv6|ipv4]] [--output-format FORMAT] [--anonymous-proxy|--satellite-provider|--anycast]'::
70 Lists all networks that have a certain flag.
71 +
72 See above for usage of the '--family' and '--output-format' parameters.
73
74 '--help'::
75 Shows a short help text on using this program.
76
77 '--version'::
78 Shows the program's version and exists.
79
80 == EXIT CODES
81 The 'location-query' command will normally exit with code zero.
82 If there has been a problem and the requested action could not be performed,
83 the exit code is unequal to zero.
84
85 == BUGS
86 Please report all bugs to the bugtracker at https://bugzilla.ipfire.org/.
87
88 == AUTHORS
89 Michael Tremer