Skip to content

Instantly share code, notes, and snippets.

@ibrezm1
Created June 22, 2022 05:08
Show Gist options
  • Save ibrezm1/244287626d3420365b6919647b2aad40 to your computer and use it in GitHub Desktop.
Save ibrezm1/244287626d3420365b6919647b2aad40 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
#$ python3 ip-to-hostname.py 216.58.196.4
#Address: 216.58.196.4
#Host: ('kul08s09-in-f4.1e100.net', [], ['216.58.196.4'])
import socket
import sys
address = sys.argv[1]
host = socket.gethostbyaddr(address)
print('Address: ', address, '\n' 'Host: ', host)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment