1. Introduction
nali, the name is taken from the Chinese pinyin of "where". nali contains a set of command line programs, its main function is to append the IP string output by some network tools with geographical location information (using the innocent database QQWry.Dat). For example, 74.125.128.104 would become 74.125.128.104 [Google Inc., Mountain View, California, USA]. The query is performed locally and will not be performed online, so the efficiency will not have any impact on the original command.
Currently includes the following commands:
nali
nali-dig
nali-nslookup
nali-traceroute
nali-tracepath
nali-ping
The prerequisite for using these commands is that they correspond to the commands must exist. For example, if you want to use nali-dig, you must ensure that dig exists. Their usage is the same as the original command. For example, nali-dig is used the same as dig. (nali-dig is equivalent to dig |nali)
2. Download
# wget --no-check-certificate http://qqwry.googlecode.com/files/nali-0.2.tar.gz
3. Installation
# tar zxvf nali-0.2.tar.gz
# cd nali-0.2
# ./configure
# make && make install
Fourth, update the IP database
You can use nali -update command to update the IP database
/usr/local/share/QQWry.Dat This file needs to be updated frequently, otherwise the error will be relatively large.
5. Use
5.1. nali
# nali 74.125.128.106
# nali 61.135.169.105
5.2. nali-dig
# nali-dig www.google. com
5.3. nali-nslookup
# nali-nslookup www.google.com
5.4. nali-traceroute
# nali-traceroute www.google.com
5.5. nali-tracepath
# nali-tracepath www.baidu.com
5.6. nali-ping
# nali-ping www.163.com
5.7. When other programs call nali to display the IP physical location, redirection can be used. For example:
# mtr www.google.com|nali
In other words, the nali command can append geographic information to the standard output IP. In the same way, if you don't like to use nali-dig, you can also use commands like dig ip|nali.
6. Alias
If you find it troublesome to enter nali-xxx, you can do some aliases, for example:
# alias traceroute='nali-traceroute'
# alias dig='nali-dig'
For more gadgets that display IP geographical location information under Linux-nali related articles, please pay attention to the PHP Chinese website!