Seems better to write this as:

    if (is.undefined(host)) {
        host = '127.0.0.1'
    }

    if (!is.hostAddress(host)) {
        deferred.reject(new Error('invalid host: ' + util.inspect(host));
        return deferred.promise;
    }

That way it won't silently convert a bogus hostname into 127.0.0.1