Skip to content

Instantly share code, notes, and snippets.

@samstarling
Created January 4, 2011 16:23
Show Gist options
  • Save samstarling/764988 to your computer and use it in GitHub Desktop.
Save samstarling/764988 to your computer and use it in GitHub Desktop.
import dns.resolver
r = dns.resolver.get_default_resolver()
try:
ans = r.query('0.cec1.c189.ce1.dab.radiodns.org', 'CNAME')
print 'CNAME', ans[0].target
except NoAnswer:
print 'No answer'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment