Segmented contracted scalar-relativistic (23s16p12d6f)/[18s12p9d3f] all-electron basis sets for lanthanides La-Lu primarily for use in second-order Douglas-Kroll-Hess density functional calculations are presented. Atomic test calculations at the scalar-relativistic Hartree-Fock level reveal an accurate description of the first to fourth ionization potentials as well as low-energy d-f and d-p excitation energies; i.e., reference data obtained with optimized (34s28p22d16f) even-tempered basis sets are reproduced with mean absolute errors of 0.003 (IP1), 0.013 (IP2), 0.030 (IP3), 0.098 (IP4), 0.070 (d-f), and 0.018 (d-p) eV. Results of molecular test calculations are presented for the lanthanide trihalides LnX3 (Ln = La-Lu, X = F, Cl, Br, I) at the PBE0 hybrid density functional theory level. Compared to recently published basis sets of identical size, the sets proposed here show substantially smaller errors in the atomic test calculations as well as lower total energies and produce results of similar accuracy in the molecular calibration study.