Created
March 27, 2018 07:43
-
-
Save jjsantanna/e9d64557e7bcbc2f0a4448fb778df694 to your computer and use it in GitHub Desktop.
Domain name to IPv6
This file contains hidden or 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 domain2ipv6(domain_name): | |
ipv6 = subprocess.Popen(['dig', domain_name, 'AAAA', '+short'], | |
stdout=subprocess.PIPE).communicate()[0].decode("utf-8").replace('\n','') | |
if ipv6=='': | |
ipv6='NaN' | |
return ipv6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment