  Diffuse interstellar bands (DIBs) trace warm neutral and weakly-ionized
diffuse interstellar medium (ISM). Here we present a dedicated, high
signal-to-noise spectroscopic study of two of the strongest DIBs, at 5780 and
5797 \AA, in optical spectra of 666 early-type stars in the Small and Large
Magellanic Clouds, along with measurements of the atomic Na\,{\sc i}\,D and
Ca\,{\sc ii}\,K lines. The resulting maps show for the first time the
distribution of DIB carriers across large swathes of galaxies, as well as the
foreground Milky Way ISM. We confirm the association of the 5797 \AA\ DIB with
neutral gas, and the 5780 \AA\ DIB with more translucent gas, generally tracing
the star-forming regions within the Magellanic Clouds. Likewise, the Na\,{\sc
i}\,D line traces the denser ISM whereas the Ca\,{\sc ii}\,K line traces the
more diffuse, warmer gas. The Ca\,{\sc ii}\,K line has an additional component
at $\sim200$--220 km s$^{-1}$ seen towards both Magellanic Clouds; this may be
associated with a pan-Magellanic halo. Both the atomic lines and DIBs show
sub-pc-scale structure in the Galactic foreground absorption; the 5780 and 5797
\AA\ DIBs show very little correlation on these small scales, as do the
Ca\,{\sc ii}\,K and Na\,{\sc i}\,D lines. This suggests that good correlations
between the 5780 and 5797 \AA\ DIBs, or between Ca\,{\sc ii}\,K and Na\,{\sc
i}\,D, arise from the superposition of multiple interstellar structures.
Similarity in behaviour between DIBs and Na\,{\sc i} in the SMC, LMC and Milky
Way suggests the abundance of DIB carriers scales in proportion to metallicity.
