diff --git a/README.md b/README.md index c83b94c..6e434b6 100644 --- a/README.md +++ b/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 +``` diff --git a/bin/ptr-search.py b/bin/ptr-search.py index a3a8c70..7b1d60f 100644 --- a/bin/ptr-search.py +++ b/bin/ptr-search.py @@ -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: - print (str(ip)) + if args.v: + print (str(ip))