The relative production rate of B0s and B 0 mesons is determined with the hadronic decays B0s→D−sπ+ and B 0 → D − K +. The measurement uses data corresponding to 1.0 fb−1 of pp collisions at a centre-of-mass energy of s√=7 TeV recorded in the forward region with the LHCb experiment. The ratio of production rates, f s /f d , is measured to be 0.238 ± 0.004 ± 0.015 ± 0.021, where the first uncertainty is statistical, the second systematic, and the third theoretical. This is combined with a previous LHCb measurement to obtain f s /f d = 0.256 ± 0.020. The dependence of f s /f d on the transverse momentum and pseudorapidity of the B meson is determined using the decays B0s→D−sπ+ and B 0 → D −π+. There is evidence for a decrease with increasing transverse momentum, whereas the ratio remains constant as a function of pseudorapidity. In addition, the ratio of branching fractions of the decays B 0 → D − K + and B 0 → D −π+ is measured to be 0.0822 ± 0.0011 (stat) ± 0.0025 (syst).