Skip to content

thebunjo/PyHost2IP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Usage

python host2ip.py

Information

Hostname to IP Address Converter

This simple Python code serves as a tool for converting a user-entered hostname (e.g., www.example.com) into its corresponding IP address. Additionally, it provides a warning if the user submits an empty input and allows the user to terminate the program. If the provided hostname is invalid or unreachable, an error message is displayed. You can also terminate the program at any time using the Ctrl+C key combination.

This code utilizes the setdefaulttimeout and gethostbyname functions from the socket module to perform a basic networking task. The user has a basic interface to terminate the process or handle unexpected errors.

#python #host2ip #hosttoip