A narrow-linewidth Q-switched random fiber laser (RFL) based on a half-opened cavity, which is realized by narrow-linewidth fiber Bragg grating (FBG) and a section of 3 km passive fiber, has been proposed and experimentally investigated. The narrow-linewidth lasing is generated by the spectral filtering of three FBGs with linewidth of 1.21 nm, 0.56 nm, and 0.12 nm, respectively. The Q switching of the distributed cavity is achieved by placing an acousto-optical modulator (AOM) between the FBG and the passive fiber. The maximal output powers of the narrow-linewidth RFLs with the three different FBGs are 0.54 W, 0.27 W, and 0.08 W, respectively. Furthermore, the repetition rates of the output pulses are 500 kHz, and the pulse durations are about 500 ns. The corresponding pulse energies are about 1.08 μJ, 0.54 μJ, and 0.16 μJ, accordingly. The linewidth of FBG can influence the output characteristics in full scale. The narrower the FBG, the higher the pump threshold; the lower the output power at the same pump level, the more serious the linewidth broadening; and thus the higher the proportion of the CW-ground exists in the output pulse trains. Thanks to the assistance of the band-pass filter (BPF), the proportion of the CW-ground of narrow-linewidth Q-switched RFL under the relative high-pump-low-output condition can be reduced effectively. The experimental results indicate that it is challenging to demonstrate a narrow-linewidth Q-switched RFL with high quality output. But further power scaling and linewidth narrowing is possible in the case of operating parameters, optimization efforts, and a more powerful pump source. To the best of our knowledge, this is the first demonstration of narrow-linewidth generation in a Q-switched RFL.