Skip to content

Instantly share code, notes, and snippets.

@kfiresmith
Created July 13, 2017 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kfiresmith/bad9f21042a747c20b28c71273b83368 to your computer and use it in GitHub Desktop.
Save kfiresmith/bad9f21042a747c20b28c71273b83368 to your computer and use it in GitHub Desktop.
def my_dns(lookup_string):
my_record = urllib.request.urlopen(lookup_string)
data = my_record.read()
encoding = my_record.info().get_content_charset('utf-8')
dns = json.loads(data.decode(encoding))
return(dns[0]["value"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment