Conjugate beamforming (CB) and zero-forcing (ZF) are well-known linear precoders, which have optimized hardware implementations. In this work, a linear precoder is proposed based on switching between CB and ZF for line-of-sight propagation environments. The proposed idea is to predict and use the precoder, which results in the highest sum-rate for a given channel. To this end, three regimes are introduced for the ratio of power per user at the base station (BS) over noise power at a user receiver. For low values of this ratio, CB and for high values, ZF result in the highest sum-rate. For moderate values, a precoding strategy is proposed to switch to the best precoder. The switching mechanism is based on an upper bound for the ZF sum-rate, which we introduced in this work. The proposed precoding strategy achieves a sum-rate higher than both CB and ZF. Simulation results for a massive MIMO system including a 100-antenna BS, show up to 8% improvement on the sum-rate compared to CB and ZF. In addition, the proposed precoder reduces computational complexity up to 16.5% compared to the ZF precoding.