A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/346774.html below:

socket.gethostbyaddr problem

socket.gethostbyaddr problem socket.gethostbyaddr problemIrmen de Jong irmen.NOSPAM at xs4all.nl
Sat Sep 17 22:52:37 EDT 2005
Mohammed Smadi wrote:
> hi;
> I am trying to do some very basic socket programming and i get the 
> following error.  Any help will be appreciated:
> 
> Code:
> import socket
> x = socket.gethostbyaddr("www.google.ca")
> 
> return an error: socket.herror: (1, 'Unknown host')

You're using the wrong method.

 >>> socket.gethostbyname("www.google.ca")
'66.102.9.147'


--Irmen

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4