Home  >  Article  >  php教程  >  A small tool that displays IP geographical location information under Linux-nali

A small tool that displays IP geographical location information under Linux-nali

高洛峰
高洛峰Original
2016-12-15 14:43:291499browse

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

A small tool that displays IP geographical location information under Linux-nali

A small tool that displays IP geographical location information under Linux-nali

Fourth, update the IP database

You can use nali -update command to update the IP database

A small tool that displays IP geographical location information under Linux-nali

/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

A small tool that displays IP geographical location information under Linux-nali

5.2. nali-dig

# nali-dig www.google. com

A small tool that displays IP geographical location information under Linux-nali

5.3. nali-nslookup

# nali-nslookup www.google.com

A small tool that displays IP geographical location information under Linux-nali

5.4. nali-traceroute

# nali-traceroute www.google.com

A small tool that displays IP geographical location information under Linux-nali

5.5. nali-tracepath

# nali-tracepath www.baidu.com

A small tool that displays IP geographical location information under Linux-nali

5.6. nali-ping

# nali-ping www.163.com

A small tool that displays IP geographical location information under Linux-nali

5.7. When other programs call nali to display the IP physical location, redirection can be used. For example:

# mtr www.google.com|nali

A small tool that displays IP geographical location information under Linux-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'

A small tool that displays IP geographical location information under Linux-nali



For more gadgets that display IP geographical location information under Linux-nali related articles, please pay attention to the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn