Socket - gaierror



Hi all,

I'm having trouble with the socket module resolving a hostname. It
seems like this is a system level problem, but I'm not even sure where
to start. I can ping the smtp server by name and IP, but when
smtp.SMTP("theHost") tries to get the hostname, it keeps giving me the
following error:

File "bin/program.py", line 123, in notify
smtp = smtplib.SMTP("theHost")

File "/usr/lib/python2.4/smtplib.py", line 255, in __init__
addr = socket.gethostbyname(socket.gethostname())

gaierror: (-2, 'Name or service not known')

I tried changing to a different smtp server, using an ip instead of a
host name. I could ping both boxes by name oor IP.

any ideas?

~Sean

.



Relevant Pages

  • Re: Socket - gaierror
    ... I'm having trouble with the socket module resolving a hostname. ... I tried changing to a different smtp server, using an ip instead of a ... I could ping both boxes by name oor IP. ...
    (comp.lang.python)
  • Re: Strange problem with linux samba
    ... > When I ping -c1 silvermountain ... hostname resolution is performed through standard ... services that talk to a DNS server. ... will talk to DNS to look for a DNS ...
    (comp.protocols.smb)
  • Perplexing Ultra 60 networking issue
    ... address was bound to the on-board 100 basetT Ethernet port, hme0. ... The plan is to migrate to using rge0, ... hostname in it, just in case, and added the new IP ... On another machine, I run ping -s 192.168.0.5, which should send a steady stream ...
    (comp.unix.solaris)
  • Re: Need help on a strange dns client issue
    ... Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net ... but it can ping the same computer by IP address. ... When pinging by hostname, I get the "Unknown host" message. ... If I stop the DNS Client service however, I can ping the host by ...
    (microsoft.public.windows.server.networking)
  • Re: can not ping hostnames of other subnet
    ... Thanks i can ping when i write hostnames but still i can not add member ... i can ping dns server with ip and hostname ... It can not find the domain name from other subnet so i can not add member ... > Anytime you are trying to ping by hostname, the name needs to be resolved ...
    (microsoft.public.win2000.ras_routing)