Web Analytics

Python socket.gethostbyname() Function

Networkingโ€ขSocket

The socket.gethostbyname() function translates a hostname to IPv4 address format.

Syntax

socket.gethostbyname(hostname)

Return Value

A string representing the IPv4 address.

Example

Output
Click Run to execute your code