A silencer for a firearm, in particular a handgun, is provided, comprising a silencer housing with a rear end wall, which is facing the barrel of the firearm, and a front end wall, which is remote from the rear end wall, and comprising an attachment rail, arranged on the silencer housing, for attaching the silencer to the firearm. The attachment rail is arranged on a lower side wall of the silencer housing. The silencer may also be used as a duel simulator. Also provided is a firearm with a silencer or a duel simulator.