socket.gethostbyaddr() problem

Jason Abate jason at hostway.com
Thu Feb 3 08:34:02 EST 2000


Thomas Wouters <thomas at xs4all.net> wrote in message
news:20000203091957.A6378 at xs4all.nl...
> On Wed, Feb 02, 2000 at 05:22:57PM -0600, Jason Abate wrote:
> > I'm having a problem with socket.gethostbyaddr().  If I call it as
> > root, it works fine, but if I call it as non-root, I get the following
> > exception:
> >
> >     socket.gethostbyaddr(socket.gethostname())
> >     socket.error: host not found
> >
> It works fine on my rh6.0 box here:
>
> >>> socket.gethostbyaddr(socket.gethostname())
> ('tilburg.poiesz.net', [], ['194.109.58.47'])
>
> Did you check /etc/resolv.conf as well? I do get a 'host not found' error
> when my /etc/resolv.conf is unreadable and my hostname is not listed in
> /etc/hosts. If that doesn't fix it, are you using a DNS, or are you
> unconnected and relying entirely on /etc/hosts ? Does it have the proper
> entries for your hostname ?

We finally got this working - the problem turned out to be that our DNS
server
was not setup to allow reverse lookups on the machine we were testing on,
which
caused the lookup to fail.  Once we enabled reverse lookups, it worked like
a charm.

Thanks,

-jason


-------------------------------
Jason Abate
Hostway Corporation
jason at hostway.com





More information about the Python-list mailing list