We consider the NLS with variable coefficients in dimension n ≥ 3on R n or more generally on an exterior domain with Dirichlet boundary conditions, for a gauge invariant, defocusing nonlinearity of power type f (u) ≃ |u| γ−1 u. We assume that L is a small, long range perturbation of ∆, plus a potential with a large positive part. The first main result of the paper is a bilinear smoothing (interaction Morawetz) estimate for the solution.As an application, under the conditional assumption that Strichartz estimates are valid for the linear flow e itL , we prove global well posedness in the energy space for subcritical powers γ < 1 + 4 n−2 , and scattering provided γ > 1 + 4 n . When the domain is R n , by extending the Strichartz estimates due to Tataru [32], we prove that the conditional assumption is satisfied and deduce well posedness and scattering in the energy space.