Simple utility to get the FQDN of a machine. Can be used synchronously or asynchronously
Why?: os.hostname() only returns the hostname rather than the FQDN
const fqdn = require('fqdn-multi');
// Async
fqdn((err, name) => {
if(err) {
throw err;
}
console.log(name);
});
/* OR */
// Sync
const name = fqdn();
Works on Windows, Linux and MacOS
This code is based on the original code.