Created
July 13, 2017 00:07
-
-
Save kfiresmith/bad9f21042a747c20b28c71273b83368 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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