Using an efficient and eco-friendly approach, 14 4-aryl-7,7-dimethyl-1,2,3,4,5,6,7,8-octahydroquinazolin-2,5-diones (and six of their 2-thione analogues) were prepared in good yields and in short reaction times by a three-component reaction of an araldehyde, dimedone and urea (or thiourea) using Fe3O4 nanoparticles in aqueous ethanol under reflux conditions. The Fe3O4 nanoparticles, which were easily prepared and could be recycled, were fully characterised by TEM, SEM, XRD, EDX, VSM and FTIR analysis.