Discovering ways to control the magnetic state of media with the lowest possible production of heat and at the fastest possible speeds is important in the study of fundamental magnetism1,2,3,4,5, with clear practical potential. In metals, it is possible to switch the magnetization between two stable states (and thus to record magnetic bits) using femtosecond circularly polarized laser pulses6,7,8. However, the switching mechanisms in these materials are directly related to laser-induced heating close to the Curie temperature9,10,11,12. Although several possible routes for achieving all-optical switching in magnetic dielectrics have been discussed13,14, no recording has hitherto been demonstrated. Here we describe ultrafast all-optical photo-magnetic recording in transparent films of the dielectric cobalt-substituted garnet. A single linearly polarized femtosecond laser pulse resonantly pumps specificd-dtransitions in the cobalt ions, breaking the degeneracy between metastable magnetic states. By changing the polarization of the laser pulse, we deterministically steer the net magnetization in the garnet, thus writing ‘0’ and ‘1’ magnetic bits at will. This mechanism outperforms existing alternatives in terms of the speed of the write-read magnetic recording event (less than 20 picoseconds) and the unprecedentedly low heat load (less than 6 joules per cubic centimetre).