Socket
Socket
Sign inDemoInstall

get-fqdn

Package Overview
Dependencies
0
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    get-fqdn

Lookup the fully qualified domain name ("FQDN") of the current server's IP (default) or a custom IP. 90x faster than `hostname -f` and works with Node v6.4+.


Version published
Maintainers
2
Install size
5.56 kB
Created

Readme

Source

get-fqdn

build status code style styled with prettier made with lass license npm downloads

Lookup the fully qualified domain name ("FQDN") of the current server's IP (default) or a custom IP. 90x faster than hostname -f and works with Node v14+.

Table of Contents

Install

npm:

npm install get-fqdn

Usage

const getFQDN = require('get-fqdn');

// async/await usage
(async () => {
  try {
    const fqdn = await getFQDN();
    console.log('fqdn', fqdn);
  } catch (err) {
    console.error(err);
  }
});

// then/catch usage
getFQDN().then(fqdn => console.log('fqdn', fqdn)).catch(console.error);

Note that you can also pass a custom IP:

const fqdn = await getFQDN('1.1.1.1');
console.log('fqdn', fqdn);

Performance

This package runs approximately 90x faster than the alternative of using hostname -f.

It was built to ensure that ForwardEmail.net is as optimized as possible.

Others packages were written in CoffeeScript, used deasync, or used the hostname -f approach (also see the fqdn package that uses the wrong approach too).

Contributors

NameWebsite
Nick Baughhttp://niftylettuce.com/

License

MIT © Nick Baugh

Keywords

FAQs

Last updated on 13 Jan 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc