We consider a bilayer consisting of a d-wave layered superconductor and diffusive ferromagnet with a domain wall (DW). The c axis in the superconductor and DW in the ferromagnet are assumed to be perpendicular to the interface. We demonstrate that in such a heterostructure the inhomogeneous exchange field enhances the proximity effect. It is shown that, whereas in the absence of the exchange field the d-wave condensate decays in the normal metal on the mean free path l, the superconductivity penetrates the ferromagnet along the DW over much larger distances. This happens because the presence of the DW results in a generation of an odd-frequency triplet s-wave component of the condensate. The phenomenon discovered here may help to explain a recent experiment on high-temperature superconductor-ferromagnet bilayers.