From 3586fa9bcd46db4f31e2308d4d266ad336c4866c Mon Sep 17 00:00:00 2001 From: Krushna Bhalerao Date: Tue, 9 Apr 2013 22:27:19 +0530 Subject: [PATCH] Create domain.py --- domain.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 domain.py diff --git a/domain.py b/domain.py new file mode 100644 index 0000000..fb37e47 --- /dev/null +++ b/domain.py @@ -0,0 +1,11 @@ +from async_dns import AsyncResolver +ar = AsyncResolver( + ["www.google.com", "www.reddit.com", "www.nonexistz.net"] + ) +resolved = ar.resolve() + +for host, ip in resolved.items(): + if ip is None: + print "%s could not be resolved." % host + else: + print "%s resolved to %s" % (host, ip)