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