try:
    answers = dns.resolver.query(args.host)
except dns.resolver.NXDOMAIN:
    print('No such domain %s' % args.host)
except dns.resolver.Timeout:
    print('Timed out while resolving %s' % args.host)
except dns.exception.DNSException:
    print('Unhandled exception')
Is it reasonable in Python to check for a specific type of exception using isinstance?