In this paper we investigated the most important family of proton conducting oxides, i.e. cerates, by means of pair distribution function analysis (PDF) obtained from total neutron scattering data. The results clearly demonstrates that the local structure plays a fundamental role in the protonation process. Oxygen vacancy creation by acceptor doping reduces the local structure symmetry which is then restored upon water uptake. This mechanism mainly involves the Ba-O shell which flexibility seems to be at the basis of the proton conduction mechanism, thus providing a direct insight on the design of optimal proton conducting materials.