mirror of
https://github.com/adulau/ptr-db.git
synced 2024-12-22 00:35:57 +00:00
ptr-search example added
This commit is contained in:
parent
f351bb975f
commit
d0dd9d700e
2 changed files with 26 additions and 2 deletions
23
README.md
23
README.md
|
@ -9,3 +9,26 @@ Requirements
|
|||
- Python 3
|
||||
- Python [redis](https://pypi.python.org/pypi/redis/) client
|
||||
- Redis [LevelDB server](https://github.com/KDr2/redis-leveldb)
|
||||
- [netaddr](https://github.com/drkjam/netaddr)
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
```shell
|
||||
./bin/ptr-search.py -s 108.4.0.0/28
|
||||
108.4.0.1,L100.RCMDVA-VFTTP-20.verizon-gni.net
|
||||
108.4.0.2,pool-108-4-0-2.rcmdva.fios.verizon.net
|
||||
108.4.0.3,pool-108-4-0-3.rcmdva.fios.verizon.net
|
||||
108.4.0.4,pool-108-4-0-4.rcmdva.fios.verizon.net
|
||||
108.4.0.5,pool-108-4-0-5.rcmdva.fios.verizon.net
|
||||
108.4.0.6,pool-108-4-0-6.rcmdva.fios.verizon.net
|
||||
108.4.0.7,pool-108-4-0-7.rcmdva.fios.verizon.net
|
||||
108.4.0.8,pool-108-4-0-8.rcmdva.fios.verizon.net
|
||||
108.4.0.9,pool-108-4-0-9.rcmdva.fios.verizon.net
|
||||
108.4.0.10,pool-108-4-0-10.rcmdva.fios.verizon.net
|
||||
108.4.0.11,pool-108-4-0-11.rcmdva.fios.verizon.net
|
||||
108.4.0.12,pool-108-4-0-12.rcmdva.fios.verizon.net
|
||||
108.4.0.13,pool-108-4-0-13.rcmdva.fios.verizon.net
|
||||
108.4.0.14,pool-108-4-0-14.rcmdva.fios.verizon.net
|
||||
108.4.0.15,pool-108-4-0-15.rcmdva.fios.verizon.net
|
||||
```
|
||||
|
|
|
@ -14,7 +14,7 @@ import netaddr
|
|||
|
||||
argParser = argparse.ArgumentParser(description='ptr-db: Search PTR records')
|
||||
argParser.add_argument('-s', action='append', help='IPv4 subnet to lookup')
|
||||
argParser.add_argument('-v', action='store_true', default=False, help='Dump queries')
|
||||
argParser.add_argument('-v', action='store_true', default=False, help='Verbose output including non-existing PTR records')
|
||||
args = argParser.parse_args()
|
||||
|
||||
if args.s is None:
|
||||
|
@ -32,4 +32,5 @@ for subnet in args.s:
|
|||
if ptr is not None:
|
||||
print (str(ip)+","+str(r.get(ip), 'utf-8'))
|
||||
else:
|
||||
if args.v:
|
||||
print (str(ip))
|
||||
|
|
Loading…
Reference in a new issue