NMS-6886: Added improved checked for hostname resolution