Skip to content

michael-benin-CN/public-ip

 
 

Repository files navigation

public-ip Build Status

Get your public IP address - very fast!

Queries the DNS records of OpenDNS which has an entry with your IP address.

CLI

$ npm install --global public-ip
$ public-ip --help

  Example
    $ public-ip
    46.5.21.123
$ time public-ip
46.5.21.123

real    0.08s
user    0.05s
sys     0.02s

API

$ npm install --save public-ip
var publicIp = require('public-ip');

publicIp(function (err, ip) {
	console.log(ip);
	//=> 46.5.21.123
});

Related

See internal-ip to get your internal IP address.

License

MIT © Sindre Sorhus

About

Get your public IP address - very fast!

Resources

License

Stars

Watchers

Forks

Packages

No packages published