Created
March 27, 2018 07:42
-
-
Save jjsantanna/2556d5fb690b7f7d5411de8dd4c2f21c to your computer and use it in GitHub Desktop.
IPv4 to rDNS (or host)
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 ipv42rdns(ipv4): | |
rdns = subprocess.Popen(['dig', '-x', ipv4, '+short'], | |
stdout=subprocess.PIPE).communicate()[0].decode("utf-8").replace('\n','') | |
return rdns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment