go install github.com/zu1k/nali@latest
C:\Users\Administrator>go install github.com/zu1k/nali@latest
$ nali 1.2.3.4
1.2.3.4 [澳大利亚 APNIC Debogon-prefix网络]
C:\Users\Administrator>nali 1.2.3.4
1.2.3.4 [澳大利亚 APNIC Debogon-prefix网络]
$ echo IP 6.6.6.6 | nali
IP 6.6.6.6 [美国 亚利桑那州华楚卡堡市美国国防部网络中心]
C:\Users\Administrator>echo IP 6.6.6.6 | nali
IP 6.6.6.6 [美国亚利桑那州华楚卡堡市 美国国防部网络中心]
$ nali 1.2.3.4 4.3.2.1 123.23.3.0
1.2.3.4 [澳大利亚 APNIC Debogon-prefix网络]
4.3.2.1 [美国 新泽西州纽瓦克市Level3Communications]
123.23.3.0 [越南 越南邮电集团公司]
C:\Users\Administrator>nali 1.2.3.4 4.3.2.1 123.23.3.0
1.2.3.4 [澳大利亚 APNIC Debogon-prefix网络] 4.3.2.1 [美国新泽西州纽瓦克市 Level3Communications] 123.23.3.0 [越南 越南邮电集团公司]
exit
或 quit
退出查询$ nali
123.23.23.23
123.23.23.23 [越南 越南邮电集团公司]
1.0.0.1
1.0.0.1 [美国 APNIC&CloudFlare公共DNS服务器]
8.8.8.8
8.8.8.8 [美国 加利福尼亚州圣克拉拉县山景市谷歌公司DNS服务器]
quit
C:\Users\Administrator>nali
255.255.255.0
255.255.255.0 [纯真网络 2023年05月10日IP数据]
192.168.1.1
192.168.1.1 [局域网 对方和您在同一内部网]
www.baidu.com
www.baidu.com
112.241.85.156
112.241.85.156 [山东省聊城市 联通]
1.2.3.4
1.2.3.4 [澳大利亚 APNIC Debogon-prefix网络]
1.0.0.1
1.0.0.1 [美国 APNIC&CloudFlare公共DNS服务器]
8.8.8.8
8.8.8.8 [美国加利福尼亚州圣克拉拉县山景市 谷歌公司DNS服务器]
quit
$ dig nali.zu1k.com +short | nali
104.28.2.115 [美国 CloudFlare公司CDN节点]
104.28.3.115 [美国 CloudFlare公司CDN节点]
172.67.135.48 [美国 CloudFlare节点]
C:\Users\Administrator>dig www.baidu.com +short | nali
39.156.66.14 [北京市 移动]
$ nslookup nali.zu1k.com 8.8.8.8 | nali
Server: 8.8.8.8 [美国 加利福尼亚州圣克拉拉县山景市谷歌公司DNS服务器]
Address: 8.8.8.8 [美国 加利福尼亚州圣克拉拉县山景市谷歌公司DNS服务器]#53
Non-authoritative answer:
Name: nali.zu1k.com
Address: 104.28.3.115 [美国 CloudFlare公司CDN节点]
Name: nali.zu1k.com
Address: 104.28.2.115 [美国 CloudFlare公司CDN节点]
Name: nali.zu1k.com
Address: 172.67.135.48 [美国 CloudFlare节点]
C:\Users\Administrator>nslookup nali.zu1k.com 8.8.8.8 | nali
*** Request to dns.google timed-out
Server: dns.google
Address: 8.8.8.8 [美国加利福尼亚州圣克拉拉县山景市 谷歌公司DNS服务器]
DNS request timed out.
timeout was 2 seconds.
bash abc.sh | nali
$ nslookup google.com | nali
Server: 127.0.0.53 [局域网 IP]
Address: 127.0.0.53 [局域网 IP]#53
Non-authoritative answer:
Name: google.com
Address: 216.58.211.110 [美国 Google全球边缘网络]
Name: google.com
Address: 2a00:1450:400e:809::200e [荷兰Amsterdam Google Inc. 服务器网段]
C:\Users\Administrator>nslookup google.com | nali
Non-authoritative answer:
Server: UnKnown
Address: fe80::1 [局域网 本地链路单播地址]
Name: google.com [Google Web 业务]
Address: 142.251.42.238 [美国 加利福尼亚州圣克拉拉县山景市谷歌公司]
$ nslookup www.gov.cn | nali
Server: 127.0.0.53 [局域网 IP]
Address: 127.0.0.53 [局域网 IP]#53
Non-authoritative answer:
www.gov.cn canonical name = www.gov.cn.bsgslb.cn [白山云 CDN].
www.gov.cn.bsgslb.cn [白山云 CDN] canonical name = zgovweb.v.bsgslb.cn [白山云 CDN].
Name: zgovweb.v.bsgslb.cn [白山云 CDN]
Address: 103.104.170.25 [新加坡 ]
Name: zgovweb.v.bsgslb.cn [白山云 CDN]
Address: 2001:428:6402:21b::5 [美国Louisiana州Monroe Qwest Communications Company, LLC (CenturyLink)]
Name: zgovweb.v.bsgslb.cn [白山云 CDN]
Address: 2001:428:6402:21b::6 [美国Louisiana州Monroe Qwest Communications Company, LLC (CenturyLink)]
C:\Users\Administrator>nslookup www.gov.cn | nali
Non-authoritative answer:
Server: UnKnown
Address: fe80::1 [局域网 本地链路单播地址]
Name: zgovweb.v.bsgslb.cn [白山云 CDN]
Addresses: 2409:8720:b201:300::8:fe [中国 江苏省 泰州市 海陵区 中国移动政企专线]
2409:8720:b201:300::8:fb [中国 江苏省 泰州市 海陵区 中国移动政企专线]
2409:8728:6aff:f00e::1:6a [中国 浙江省 金华市 婺城区 中国移动政企专线]
2409:8720:b201:300::8:fc [中国 江苏省 泰州市 海陵区 中国移动政企专线]
2409:8720:b201:300::8:fd [中国 江苏省 泰州市 海陵区 中国移动政企专线]
111.32.160.88 [天津市 移动]
111.2.79.179 [浙江省金华市 移动]
111.32.160.87 [天津市 移动]
111.32.160.86 [天津市 移动]
Aliases: www.gov.cn
www.gov.cn.bsgslb.cn [白山云 CDN]
- name: geoip
name-alias:
- geolite
- geolite2
format: mmdb
file: GeoLite2-City.mmdb
languages:
- ALL
types:
- IPv4
- IPv6
cat
命令 查看C:\Users\Administrator>cat C:\Users\Administrator\AppData\Local\nali\config.yaml
databases:
- name: qqwry
name-alias:
- chunzhen
format: qqwry
file: qqwry.dat
languages:
- zh-CN
types:
- IPv4
download-urls:
- https://gh-release.zu1k.com/HMBSbige/qqwry/qqwry.dat
- name: zxipv6wry
name-alias:
- zxipv6
- zx
format: zxipv6wry
file: zxipv6wry.db
languages:
- zh-CN
types:
- IPv6
- name: geoip
name-alias:
- geoip2
- geolite
- geolite2
format: mmdb
file: GeoLite2-City.mmdb
languages:
- ALL
types:
- IPv4
- IPv6
- name: dbip
name-alias:
- db-ip
format: mmdb
file: dbip.mmdb
languages:
- ALL
types:
- IPv4
- IPv6
- name: ipip
format: ipip
file: ipipfree.ipdb
languages:
- zh-CN
types:
- IPv4
- IPv6
- name: ip2region
name-alias:
- i2r
format: ip2region
file: ip2region.xdb
languages:
- zh-CN
types:
- IPv4
download-urls:
- https://cdn.jsdelivr.net/gh/lionsoul2014/ip2region/data/ip2region.xdb
- https://raw.githubusercontent.com/lionsoul2014/ip2region/master/data/ip2region.xdb
- name: ip2location
format: ip2location
file: IP2LOCATION-LITE-DB3.IPV6.BIN
languages:
- en
types:
- IPv4
- IPv6
- name: cdn
format: cdn-yml
file: cdn.yml
languages:
- zh-CN
types:
- CDN
download-urls:
- https://cdn.jsdelivr.net/gh/4ft35t/cdn/src/cdn.yml
- https://raw.githubusercontent.com/4ft35t/cdn/master/src/cdn.yml
- https://raw.githubusercontent.com/SukkaLab/cdn/master/src/cdn.yml
selected:
cdn: cdn
ipv4: qqwry
ipv6: zxipv6wry
lang: zh-CN
$ nali --help
Usage:
nali [flags]
nali [command]
Available Commands:
help Help about any command
update update qqwry, zxipv6wry, ip2region ip database and cdn
Flags:
-h, --help help for nali
-t, --toggle Help message for toggle
Use "nali [command] --help" for more information about a command.
C:\Users\Administrator>nali --help
An offline tool for querying IP geographic information.
Find document on: https://github.com/zu1k/nali
#1 Query a simple IP address
$ nali 1.2.3.4
or use pipe
$ echo IP 6.6.6.6 | nali
#2 Query multiple IP addresses
$ nali 1.2.3.4 4.3.2.1 123.23.3.0
#3 Interactive query
$ nali
123.23.23.23
123.23.23.23 [越南 越南邮电集团公司]
quit
#4 Use with dig
$ dig nali.zu1k.com +short | nali
#5 Use with nslookup
$ nslookup nali.zu1k.com 8.8.8.8 | nali
#6 Use with any other program
bash abc.sh | nali
#7 IPV6 support
Usage:
nali [flags]
nali [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
info get the necessary information of nali
update update qqwry, zxipv6wry, ip2region ip database and cdn
Flags:
--gbk Use GBK decoder
-h, --help help for nali
-v, --version version for nali
Use "nali [command] --help" for more information about a command.
$ nali update
2020/07/17 12:53:46 正在下载最新纯真 IP 库...
2020/07/17 12:54:05 已将最新的纯真 IP 库保存到本地 /root/.nali/qqwry.dat
C:\Users\Administrator>nali update
2023/05/15 16:19:29 正在下载最新 qqwry 数据库...
2023/05/15 16:20:29 qqwry 数据库下载失败,请手动下载解压后保存到本地: qqwry.dat
2023/05/15 16:20:29 下载链接: [https://gh-release.zu1k.com/HMBSbige/qqwry/qqwry.dat]
2023/05/15 16:20:29 error: context deadline exceeded (Client.Timeout or context cancellation while reading body)
2023/05/15 16:20:29 正在下载最新 ZX IPv6数据库...
2023/05/15 16:20:30 已将最新的 ZX IPv6数据库 保存到本地: [zxipv6wry.db]
2023/05/15 16:20:30 正在下载最新 ip2region 数据库...
2023/05/15 16:20:36 ip2region 数据库下载成功: ip2region.xdb
2023/05/15 16:20:36 正在下载最新 cdn 数据库...
2023/05/15 16:20:37 cdn 数据库下载成功: cdn.yml
$ nali update --db qqwry,cdn
2020/07/17 12:53:46 正在下载最新纯真 IP 库...
2020/07/17 12:54:05 已将最新的纯真 IP 库保存到本地 /root/.nali/qqwry.dat
https://mp.weixin.qq.com/s/TIqC6zWnffrHmpJuyZpsuA