]> git.ipfire.org Git - people/ms/libloc.git/blame - man/location-query.txt
man: Document quiet mode switch
[people/ms/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
e16d1683
MT
29--quiet::
30 Enable quiet mode
31
161ac92d
MT
32--debug::
33 Enable debugging mode
34
35== COMMANDS
36
37'lookup ADDRESS [ADDRESS...]'::
38 This command returns the network the given IP address has been found in
39 as well as its Autonomous System if that information is available.
40
41'get-as ASN [ASN...]'::
42 This command returns the name of the owning organisation of the Autonomous
43 System.
44
45'search-as STRING'::
46 Lists all Autonomous Systems which match the given string.
47 +
48 The search will be performed case-insensitively.
49
44e5ef71 50'list-networks-by-as [--family=[ipv6|ipv4]] [--output-format FORMAT] ASN'::
161ac92d 51 Lists all networks which belong to this Autonomous System.
4439e317 52 +
44e5ef71
MT
53 The '--family' parameter can be used to filter output to only IPv6 or
54 IPv4 addresses.
55 +
4439e317
MT
56 The '--output-format' parameter can change the output so that it can be
57 directly loaded into other software. The following options are available:
58 +
59 * 'list' (default): Just lists all networks, one per line
6da14cc1 60 * 'ipset': For ipset
71e0ad0b 61 * 'nftables': For nftables
4439e317
MT
62 * 'xt_geoip': Returns a list of networks to be loaded into the xt_geoip
63 kernel module
161ac92d 64
44e5ef71 65'list-networks-by-cc [--family=[ipv6|ipv4]] [--output-format FORMAT] COUNTRY_CODE'::
161ac92d
MT
66 Lists all networks that belong to a country.
67 +
68 The country has to be encoded in ISO3166 Alpha-2 notation.
4439e317 69 +
44e5ef71 70 See above for usage of the '--family' and '--output-format' parameters.
161ac92d 71
44e5ef71 72'list-networks-by-flags [--family=[ipv6|ipv4]] [--output-format FORMAT] [--anonymous-proxy|--satellite-provider|--anycast]'::
bbdb2e0a
MT
73 Lists all networks that have a certain flag.
74 +
44e5ef71 75 See above for usage of the '--family' and '--output-format' parameters.
bbdb2e0a 76
161ac92d
MT
77'--help'::
78 Shows a short help text on using this program.
79
80'--version'::
81 Shows the program's version and exists.
82
83== EXIT CODES
84The 'location-query' command will normally exit with code zero.
85If there has been a problem and the requested action could not be performed,
86the exit code is unequal to zero.
87
88== BUGS
89Please report all bugs to the bugtracker at https://bugzilla.ipfire.org/.
90
91== AUTHORS
92Michael Tremer