This module is inspired by node-fqdn but returns a promise rather than using the dasync library.
npm install fqdn-promise
fqdn = require('fqdn-promise');
// then from inside an async function
myfullhostname = await fqdn();
// or
fqdn()
.then (myfullhostname) => ...
Please report any issues or make any suggestions at the Github issues page.