Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/silverwind/ip-ptr
Get the PTR name for a given IPv4 or IPv6 address
https://github.com/silverwind/ip-ptr
Last synced: 17 days ago
JSON representation
Get the PTR name for a given IPv4 or IPv6 address
- Host: GitHub
- URL: https://github.com/silverwind/ip-ptr
- Owner: silverwind
- License: bsd-2-clause
- Created: 2017-01-17T21:41:07.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-11-09T15:24:48.000Z (about 1 year ago)
- Last Synced: 2024-04-08T09:47:54.366Z (7 months ago)
- Language: JavaScript
- Size: 48.8 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ip-ptr
[![](https://img.shields.io/npm/v/ip-ptr.svg?style=flat)](https://www.npmjs.org/package/ip-ptr) [![](https://img.shields.io/npm/dm/ip-ptr.svg)](https://www.npmjs.org/package/ip-ptr) [![](https://api.travis-ci.org/silverwind/ip-ptr.svg?style=flat)](https://travis-ci.org/silverwind/ip-ptr)
> Get the PTR name for a given IPv4 or IPv6 address## Installation
```console
$ npm i ip-ptr
```
## Example
```js
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](https://github.com/silverwind), distributed under BSD licence