Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

reverse-dns

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reverse-dns

Get the reverse domain name notation (or 'reverse DNS') for a site.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

reverse-dns Build Status

Get the reverse domain name notation (or "reverse DNS") for a site.

Install

$ npm install --save reverse-dns

Usage

const reverseDns = require('reverse-dns');

reverseDns('https://foo.example.com');
//=> 'com.example.foo'

reverseDns('https://example.com');
//=> 'com.example.www'

reverseDns('https://example.com', {name: 'bar'});
//=> 'com.example.bar'

reverseDns('https://bar.example.com', {name: 'hello'});
//=> 'com.example.hello'

reverseDns('https://example.com', {glue: '-'});
//=> 'com-example-www'

API

reverseDns(input, [options])

input

Type: string

The website URL to parse.

options.glue

Type: string
Default: .

The delimiter for joining domain segments.

options.name

Type: string
Default: www

The "name" of the domain product. Defaults to the subdomain (or "www") if found. Setting this will overwrite the value obtained from the input's subdomain.

License

MIT © Luke Edwards

Keywords

dns

FAQs

Package last updated on 26 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts