A new contactless method based on frequency-scanning heterodyne interferometry is proposed to measure the absolute length of opaque blocks with fragile reflective surfaces. This method is significant in scientific research, such as determining the absolute length of torsion pendulums in gravitational experiments or test masses in gravitational wave detection programs. In addition to avoiding possible damage caused by contact measurement, this optical setup has the potential for higher measurement accuracy compared to contact measurement apparatuses. Two gauge blocks with nominal lengths of 40 mm and 50 mm are used to test the performance of the proposed interferometer, and the measurement results closely match their nominal lengths. The combined uncertainty is 0.62μm and 0.48μm for the 40 mm and 50 mm gauge blocks respectively.