import socket
from ip2geotools.databases.noncommercial import DbIpCity
# take input url
url = input("Insert the link:")
#gethostbyname() function of socket module returns the IP address of a given host name
ip = socket.gethostbyname(url)
response = DbIpCity.get(ip,api_key='free')
# print ip
print("IP:",ip)
# print city
print("City:",response.city)
# print Region
print("Region:",response.region)
# print country
print("Country:",response.country)