ip-ptr

3.0.0 • Public • Published

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 Sidebar

Install

npm i ip-ptr

Weekly Downloads

540

Version

3.0.0

License

BSD-2-Clause

Unpacked Size

3.23 kB

Total Files

4

Last publish

Collaborators

  • silverwind