Added exception handling to the DnsToIP class