Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.
/ host-to-ip Public archive

A flexible way to look up IP addresses for host names & URLs

License

Notifications You must be signed in to change notification settings

pbnj/host-to-ip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

host-to-ip

A flexible way to look up IP addresses for host names (e.g. github.com) and URLs (e.g. https://api.github.com).

Install

npm install --save host-to-ip

Usage

const hostToIp = require('host-to-ip');

const hostname = 'github.com'
const fqdn = 'https://api.github.com'

hostToIp(hostname).then(ip => console.log(ip)).catch(err => console.error(err))
//=> '192.30.253.112'

hostToIp(fqdn, {all: true, family: 4}).then(ip => console.log(ip)).catch(err => console.error(err))
//=> [{"address": "192.30.253.116", "family": 4}, {"address": "192.30.253.117", "family": 4}]

License

MIT © Peter Benjamin

Releases

No releases published

Packages

No packages published