Catalysis of the hydrolysis of a phosphodiester to give a phosphomonoester and a free hydroxyl group.