-A method for pinning magnetic domains with prescribed shapes has been developed for the magnetooptical (MO) thin film material DYx(FeCo)J.x. The pinning array of holes on the substrate was fabricated using electron beam lithography. The thin film of DYx(FeCo)l.x sandwiched between SiN layers was deposited onto a patterned polymethyl methacrylate (PM MA) layer. The pinned domains acquire the shape of the holes, while the sharpness of their boundaries depends on the size of the holes. The stability of the pinned domains is affected by the sample's magnetization. In our experiments, the minimum stable domain size pinned within the hole arra)-\\as found to be around 30 nm in diameter.