3.0: port OpenCNAM patch to 3.0 branch