We present high-resolution H i data obtained using the Australia Telescope Compact Array to resolve the near/far distance ambiguities towards a sample of compact H ii regions from the Red MSX Source (RMS) survey. The high-resolution data are complemented with lower resolution archival H i data extracted from the Southern and Very Large Array (VLA) Galactic Plane surveys. We resolve the distance ambiguity for nearly all of the 105 sources where the continuum was strong enough to allow analysis of the H i absorption line structure. This represents another step in the determination of distances to the total RMS sample, which with over 1000 massive young stellar objects and compact H ii regions is the largest and most complete sample of its kind. The full sample will allow the distribution of massive star formation in the Galaxy to be examined.