The standard analysis of the CMB data assumes that the distance to the last scattering surface can be calculated using the distance-redshift relation as in the Friedmann model. However, in the inhomogeneous universe, even if <\delta\rho> =0, the distance relation is not the same as in the unperturbed universe. This can be of serious consequences as a change of distance affects the mapping of CMB temperature fluctuations into the angular power spectrum. In addition, if the change of distance is relatively uniform no new temperature fluctuations are generated. It is therefore a different effect than the lensing or ISW effects which introduce additional CMB anisotropies. This paper shows that the accuracy of the CMB analysis can be impaired by the accuracy of calculation of the distance within the cosmological models. Since this effect has not been fully explored before, to test how the inhomogeneities affect the distance-redshift relation, several methods are examined: the Dyer-Roeder relation, lensing approximation, and non-linear Swiss-Cheese model. In all cases, the distance to the last scattering surface is different than when homogeneity is assumed. The difference can be as low as 1% and as high as 80%. Excluding extreme cases, the distance changes by about 20-30%. Since the distance to the last scattering surface is set by the position of the CMB peaks, in order to have a good fit, the distance needs to be adjusted. After correcting the distance, the cosmological parameters change. Therefore, a not properly estimated distance to the last scattering surface can be a major source of systematics. This paper shows that if inhomogeneities are taken into account when calculating the distance then models with positive spatial curvature and with \Omega_\Lambda ~ 0.8-0.9 are preferred. The \Lambda CDM model in most cases, is at odds with the current data.