#This is how I got the hostname from the ip
import socket
# get input from user
input01 = input("
Type IP: ").upper()
#gets information
output = socket.gethostbyaddr(str(input01))
#processes the information to only get the hostname
outputProceesed = str(output).split("'")[1::2]
#prints hostname
print(f"Their Hostname is {outputProceesed[0]}
")