Restructuring code to correctly return NXDOMAIN on non-A-record requests