Threat Picture

Latest Cybersecurity News

gethostbyname(): What the Name Lookup Actually Returns

C and Python share the name but return different results. Here’s how the lookup works, where it gets an answer, and why IPv6 needs another option.
By Charles Joseph · Updated
Drawing of gethostbyname returning an example IPv4 address for a hostname.
gethostbyname retrieves IPv4 address information for a hostname, with results depending on the programming interface.
Share
Share
Copy Link