2
2
<br >Nali<br >
3
3
</h1 >
4
4
5
- <h4 align =" center " >An offline tool for querying IP geographic information and CDN provider .</h4 >
5
+ <h4 align =" center " >一个查询IP地理信息和CDN提供商的离线终端工具 .</h4 >
6
6
7
7
<p align =" center " >
8
8
<a href =" https://github.com/zu1k/nali/actions " >
16
16
</a >
17
17
</p >
18
18
19
- #### [ 中文文档 ] ( https://github.com/zu1k/nali/blob/master/README_zh-CN .md )
19
+ #### [ English ] ( https://github.com/zu1k/nali/blob/master/README_en .md )
20
20
21
- ## Origin
21
+ ## 来源
22
22
23
- Inspired by Nali C version and nali-cli js version .
23
+ 该工具受 Nali C版本 和 nali-cli js版本的启发 .
24
24
25
- I want to query the IP geographic information and CDN service provider on the terminal, then found the Nali tool. Nali mean 'where' in Chinese, good name for this kind of tools.
25
+ 我想要在终端对IP地理信息和CDN服务提供商进行查询,发现了Nali这个工具,Nali与哪里谐音,非常适合这类工具
26
26
27
- However the C version has too few functions, and the js version is too big and the supported platforms are not complete, so I rewrite it in golang, add IPv6 support and Geoip2 database.
27
+ 经过简单的使用,我发现最初的C语言版本功能缺失,而js版本包实在大的恐怖、而支持的平台非常有限,所以我用golang重写了这个工具,在原有功能的基础上增加了对IPv6的支持,并且增加了Geoip2数据库
28
28
29
- ## Feature
30
29
31
- - Multi database support
32
- - Chunzhen qqip database
33
- - ZX ipv6 database
34
- - Geoip2 city database
35
- - IPIP free database
36
- - ip2region database
37
- - Pipeline support
38
- - Interactive query
39
- - Offline query
40
- - Both ipv4 and ipv6 supported
41
- - Multilingual support
42
- - CDN provider query
43
- - Full platform support
44
- - Color print
30
+ ## 功能
45
31
46
- ## Install
32
+ - 支持多种数据库
33
+ - 纯真 IPv4 离线数据库
34
+ - ZX IPv6 离线数据库
35
+ - Geoip2 城市数据库 (可选)
36
+ - IPIP 数据库 (可选)
37
+ - ip2region 数据库 (可选)
38
+ - CDN 服务提供商查询
39
+ - 支持管道处理
40
+ - 支持交互式查询
41
+ - 同时支持IPv4和IPv6
42
+ - 支持多语言
43
+ - 查询完全离线
44
+ - 全平台支持
45
+ - 支持彩色输出
47
46
48
- ### Install from source
47
+ ## 安装
49
48
50
- Nali Requires Go >= 1.18. You can build it from source:
49
+ ### 从源码安装
50
+
51
+ Nali 需要预先安装 Go >= 1.18. 安装后可以从源码安装软件:
51
52
52
53
``` sh
53
54
$ go install github.com/zu1k/nali
54
55
```
55
56
56
- ### Install pre-build binariy
57
+ ### 下载预编译的可执行程序
57
58
58
- Pre-built binaries are available here : [ release ] ( https://github.com/zu1k/nali/releases )
59
+ 可以从Release页面下载预编译好的可执行程序 : [ Release ] ( https://github.com/zu1k/nali/releases )
59
60
60
- Download the binary compatible with your platform, unpack and copy to the directory in path
61
+ 你需要选择适合你系统和硬件架构的版本下载,解压后可直接运行
61
62
62
- ## Usage
63
+ ## 使用说明
63
64
64
- ### Query a simple IP address
65
+ ### 查询一个IP的地理信息
65
66
66
67
```
67
68
$ nali 1.2.3.4
68
69
1.2.3.4 [澳大利亚 APNIC Debogon-prefix网络]
69
70
```
70
71
71
- #### or use ` pipe `
72
+ #### 或者 使用 ` 管道 `
72
73
73
74
```
74
75
$ echo IP 6.6.6.6 | nali
75
76
IP 6.6.6.6 [美国 亚利桑那州华楚卡堡市美国国防部网络中心]
76
77
```
77
78
78
- ### Query multiple IP addresses
79
+ ### 同时查询多个IP的地理信息
79
80
80
81
```
81
82
$ nali 1.2.3.4 4.3.2.1 123.23.3.0
@@ -84,9 +85,9 @@ $ nali 1.2.3.4 4.3.2.1 123.23.3.0
84
85
123.23.3.0 [越南 越南邮电集团公司]
85
86
```
86
87
87
- ### Interactive query
88
+ ### 交互式查询
88
89
89
- use ` exit ` or ` quit ` to quit
90
+ 使用 ` exit ` 或 ` quit ` 退出查询
90
91
91
92
```
92
93
$ nali
@@ -99,7 +100,9 @@ $ nali
99
100
quit
100
101
```
101
102
102
- ### Use with dig
103
+ ### 与 ` dig ` 命令配合使用
104
+
105
+ 需要你系统中已经安装好 dig 程序
103
106
104
107
```
105
108
$ dig nali.lgf.im +short | nali
@@ -108,7 +111,9 @@ $ dig nali.lgf.im +short | nali
108
111
172.67.135.48 [美国 CloudFlare节点]
109
112
```
110
113
111
- ### Use with nslookup
114
+ ### 与 ` nslookup ` 命令配合使用
115
+
116
+ 需要你系统中已经安装好 nslookup 程序
112
117
113
118
```
114
119
$ nslookup nali.lgf.im 8.8.8.8 | nali
@@ -124,19 +129,19 @@ Name: nali.lgf.im
124
129
Address: 172.67.135.48 [美国 CloudFlare节点]
125
130
```
126
131
127
- ### Use with any other program
132
+ ### 与任意程序配合使用
128
133
129
- Because nali can read the contents of the ` stdin ` pipeline, it can be used with any program
134
+ 因为 nali 支持管道处理,所以可以和任意程序配合使用
130
135
131
136
```
132
137
bash abc.sh | nali
133
138
```
134
139
135
- Nali will insert ip information after ip
140
+ Nali 将在 IP后面插入IP地理信息,CDN域名后面插入CDN服务提供商信息
136
141
137
- ### IPV6 support
142
+ ### 支持IPv6
138
143
139
- Use like ipv4
144
+ 和 IPv4 用法完全相同
140
145
141
146
```
142
147
$ nslookup google.com | nali
@@ -150,7 +155,9 @@ Name: google.com
150
155
Address: 2a00:1450:400e:809::200e [荷兰Amsterdam Google Inc. 服务器网段]
151
156
```
152
157
153
- ### Query CDN provider
158
+ ### 查询 CDN 服务提供商
159
+
160
+ 因为 CDN 服务通常使用 CNAME 的域名解析方式,所以推荐与 ` nslookup ` 或者 ` dig ` 配合使用,在已经知道 CNAME 后可单独使用
154
161
155
162
```
156
163
$ nslookup www.gov.cn | nali
@@ -168,9 +175,9 @@ Name: zgovweb.v.bsgslb.cn [白山云 CDN]
168
175
Address: 2001:428:6402:21b::6 [美国Louisiana州Monroe Qwest Communications Company, LLC (CenturyLink)]
169
176
```
170
177
171
- ## Interface
178
+ ## 用户交互
172
179
173
- ### Help
180
+ ### 查看帮助
174
181
175
182
```
176
183
$ nali --help
@@ -179,88 +186,87 @@ Usage:
179
186
nali [command]
180
187
181
188
Available Commands:
182
- completion generate the autocompletion script for the specified shell
183
189
help Help about any command
184
190
update update chunzhen ip database
185
191
186
192
Flags:
187
- --gbk Use GBK decoder
188
- -h , --help help for nali
193
+ -h, --help help for nali
194
+ -t , --toggle Help message for toggle
189
195
190
196
Use "nali [command] --help" for more information about a command.
191
197
```
192
198
193
- ### Update database
199
+ ### 更新数据库
194
200
195
201
```
196
202
$ nali update
197
203
2020/07/17 12:53:46 正在下载最新纯真 IP 库...
198
204
2020/07/17 12:54:05 已将最新的纯真 IP 库保存到本地 /root/.nali/qqwry.dat
199
205
```
200
206
201
- ### Select database
207
+ ### 自选数据库
202
208
203
- Users can specify which database to use, set environment variables ` NALI_DB_IP4 ` , ` NALI_DB_IP6 ` or both.
209
+ 用户可以指定使用哪个数据库,需要设置环境变量: ` NALI_DB_IP4 ` 、 ` NALI_DB_IP6 ` 或者两个同时设置
204
210
205
- supported database :
211
+ 支持的变量内容 :
206
212
207
213
- Geoip2 ` ['geoip', 'geoip2', 'geo'] `
208
214
- Chunzhen ` ['chunzhen', 'qqip', 'qqwry'] `
209
215
- IPIP ` ['ipip', 'ipipfree', 'ipip.net'] `
210
216
- Ip2Resion ` ['ip2region', 'region', 'i2r'] `
211
217
212
- #### Windows
218
+ #### Windows平台
213
219
214
- ##### Use geoip db
220
+ ##### 使用geoip数据库
215
221
216
222
```
217
223
set NALI_DB_IP4=geoip
218
224
219
- or use powershell
225
+ 或者使用 powershell
220
226
221
227
$env:NALI_DB_IP4="geoip"
222
228
```
223
229
224
- ##### Use ipip db
230
+ ##### 使用ipip数据库
225
231
226
232
```
227
233
set NALI_DB_IP6=ipip
228
234
229
- or use powershell
235
+ 或者使用 powershell
230
236
231
237
$env:NALI_DB_IP6="ipip"
232
238
```
233
239
234
- #### Linux
240
+ #### Linux平台
235
241
236
- ##### Use geoip db
242
+ ##### 使用geoip数据库
237
243
238
244
```
239
245
export NALI_DB_IP4=geoip
240
246
```
241
247
242
- ##### Use ipip db
248
+ ##### 使用ipip数据库
243
249
244
250
```
245
- export NALI_DB_IP6 =ipip
251
+ export NALI_DB_IP4 =ipip
246
252
```
247
253
248
- ### Multilingual support
254
+ ### 多语言支持
249
255
250
- Specify the language to be used by modifying the environment variable ` NALI_LANG ` , when using a non-Chinese language only the GeoIP2 database is supported
256
+ 通过修改环境变量 ` NALI_LANG ` 来指定使用的语言,当使用非中文语言时仅支持GeoIP2这个数据库
251
257
252
- The values that can be set for this parameter can be found in the list of supported databases for GeoIP2
258
+ 该参数可设置的值见 GeoIP2 这个数据库的支持列表
253
259
254
260
```
255
261
# NALI_LANG=en nali 1.1.1.1
256
262
1.1.1.1 [Australia]
257
263
```
258
264
259
- ### Change database directory
265
+ ### 更换数据库目录
260
266
261
- If the database directory is not specified, the database will be placed in ` ~/.nali `
267
+ 如果未指定数据库存放目录,数据库默认将存放在 ` ~/.nali `
262
268
263
- Set environment variables ` NALI_DB_HOME ` to specify the database directory
269
+ 设置环境变量 ` NALI_DB_HOME ` 来指定数据库目录
264
270
265
271
```
266
272
set NALI_DB_HOME=D:\nalidb
270
276
export NALI_DB_HOME=/home/nali
271
277
```
272
278
273
- ## Thanks
279
+ ## 感谢列表
274
280
275
281
- [ 纯真QQIP离线数据库] ( http://www.cz88.net/fox/ipdat.shtml )
276
282
- [ qqwry mirror] ( https://qqwry.mirror.noc.one/ )
@@ -285,19 +291,18 @@ export NALI_DB_HOME=/home/nali
285
291
- [ Cobra CLI库] ( https://github.com/spf13/cobra )
286
292
- [ Nali-cli] ( https://github.com/SukkaW/nali-cli )
287
293
288
- Thanks to JetBrains for the Open Source License
294
+ 感谢 JetBrains 提供开源项目免费License
289
295
290
296
<a href =" https://www.jetbrains.com/?from=nali " >
291
297
<img src =" assets/GoLand.svg " >
292
298
</a >
293
299
294
- ## Author
300
+ ## 作者
295
301
296
- ** Nali** © [ zu1k] ( https://github.com/zu1k ) , Released under the [ MIT] ( ./LICENSE ) License .<br >
302
+ ** Nali** © [ zu1k] ( https://github.com/zu1k ) , 遵循 [ MIT] ( ./LICENSE ) 证书 .<br >
297
303
298
304
> Blog [ @zu1k ] ( https://lgf.im ) · GitHub [ @zu1k ] ( https://github.com/zu1k ) · Twitter [ @zu1k_lv] ( https://twitter.com/zu1k_lv ) · Telegram Channel [ @peekfun ] ( https://t.me/peekfun )
299
305
300
-
301
- ## Stargazers over time
306
+ ## Star统计
302
307
303
308
[ ![ Stargazers over time] ( https://starchart.cc/zu1k/nali.svg )] ( https://starchart.cc/zu1k/nali )
0 commit comments