now does the DNS lookup in python, simplifying as we dont run external command.