Abstract. In view of interpreting the cosmological observations precisely, especially when they involve narrow light beams, it is crucial to understand how light propagates in our statistically homogeneous, clumpy, Universe. Among the various approaches to tackle this issue, Swisscheese models propose an inhomogeneous spacetime geometry which is an exact solution of Einstein's equation, while the Dyer-Roeder approximation deals with inhomogeneity in an effective way. In this article, we demonstrate that the distance-redshift relation of a certain class of Swiss-cheese models is the same as the one predicted by the Dyer-Roeder approach, at a well-controlled level of approximation. Both methods are therefore equivalent when applied to the interpretation of, e.g., supernova obervations. The proof relies on completely analytical arguments, and is illustrated by numerical results.