The measurement of distance plays an important role in many aspects of modern societies. In this paper, an absolute distance measurement method for arbitrary distance is proposed and demonstrated using mode-resolved spectral interferometry with a gain-switched dual comb. An accuracy of 12 µm, when compared to a He-Ne fringe counting laser interferometer, for a displacement up to 2.5 m is demonstrated by tuning the repetition frequency of the dual comb from 1.1 GHz to 1.4 GHz. The compact measurement system based on a gain-switched dual comb breaks the constraint of periodic ambiguity. The simplification and improvements are significant for further industrial applications.