A detection technique for use with noncontact attractive mode force microscopes is described. The technique relies on the accurate measurement of the resonant frequency of a cantilever probe as it rings in response to a very short excitation pulse. The resonant frequency reflects the spatially varying interactions between the probe and the specimen under study. This technique is for cantilevers with relatively high Q values (>1000) as might be expected with vacuum operation. This technique has the advantage of being relatively easy to implement with commercially available instrumentation, while still providing excellent sensitivity and wide bandwidth operation. A sensitivity of 0.02 Hz at 75 kHz in a bandwidth of 50 Hz is comparable with other techniques. In addition, it is easy to accommodate a wide variety of cantilevers with different vibrational characteristics. A photomicrograph of the stray fields above bits written in a magnetic hard disk is presented, demonstrating the application of the technique to magnetic force microscopy.