The LSND and MiniBooNE results as well as the reactor and Gallium anomalies seem to indicate the presence of a sterile neutrino with a mass of ∼1 eV mixed with active neutrinos. Such sterile neutrino can be produced in the early universe before the neutrino decoupling, leading to a contribution to the effective number of neutrinos (Neff) as well as to a contribution to the sum of neutrino masses which are in tension with cosmological observations. We propose a scenario to relax this tension by a Yukawa coupling of the sterile neutrinos to ultra-light scalar particles which contribute to the dark matter in the background. The coupling induces an effective mass for the sterile neutrino which prevents its production in the early universe. We discuss the implications for the upcoming KATRIN experiment and future relic neutrino search experiments such as PTOLEMY.