ip-ptr

Get the PTR name for a given IPv4 or IPv6 address

BSD-2-CLAUSE License

Downloads
1.8K
Stars
4
Committers
1

ip-ptr

Get the PTR name for a given IPv4 or IPv6 address

Installation

$ npm i ip-ptr

Example

const ipPtr = require('ip-ptr');

ipPtr('1.2.3.4');
//=> 4.3.2.1.in-addr.arpa
ipPtr('2001:db8::1');
//=> 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa

API

ipPtr(ip)

  • ip string - A IPv4 or IPv6 address.

Will throw on if ip is not a valid IP address.

© silverwind, distributed under BSD licence

Package Rankings
Top 7.65% on Npmjs.org
Badges
Extracted from project README