Quantum coherence in natural and artificial spin systems is fundamental to applications ranging from quantum information science to magnetic-resonance imaging and identification. Several multipulse control sequences targeting generalized noise models have been developed to extend coherence by dynamically decoupling a spin system from its noisy environment. In any particular implementation, however, the efficacy of these methods is sensitive to the specific frequency distribution of the noise, suggesting that these same pulse sequences could also be used to probe the noise spectrum directly. Here we demonstrate noise spectroscopy by means of dynamical decoupling using a superconducting qubit with energy-relaxation time T1 D12 us. We first demonstrate that dynamical decoupling improves the coherence time T2 in this system up to the T2 D2 T1 limit (pure dephasing times exceeding 100 us), and then leverage its filtering properties to probe the environmental noise over a frequency (f) range 0.2-20 MHz, observing a 1=fa distribution with a < 1. The characterization of environmental noise has broad utility for spin-resonance applications, enabling the design of optimized coherent-control methods, promoting device and materials engineering, and generally improving coherence.