Re: getfqdn passes a hostname to gethostbyaddr instead of an ip address

2018-09-12 Thread Thomas Jollans
On 12/09/18 16:29, Florian Bergmann wrote: On the other hand I feel given the documentation, passing the `ip_address` would be the right thing to do, so I am wondering if I am missing something very obvious here (especially given that the code seems to be unchanged for 18 years). Whatever the do

Re: getfqdn passes a hostname to gethostbyaddr instead of an ip address

2018-09-12 Thread Rhodri James
On 12/09/18 15:29, Florian Bergmann wrote: Hello, While I was debugging some salt issues I dug into the python code and found a piece of code in the `socket.py` module that surprised my a bit: In the `getfqdn` function the `gethostbyaddr` name function is being called with a `hostname` instead

getfqdn passes a hostname to gethostbyaddr instead of an ip address

2018-09-12 Thread Florian Bergmann
Hello, While I was debugging some salt issues I dug into the python code and found a piece of code in the `socket.py` module that surprised my a bit: In the `getfqdn` function the `gethostbyaddr` name function is being called with a `hostname` instead of an `ipaddress`: ```python def getfqdn

Re: gethostbyaddr()

2014-07-28 Thread Edward Manning
Chris Thank you for the info. I figure it out. But thank you again. Ed > On Jul 28, 2014, at 5:42 PM, Chris Kaynor wrote: > > On Mon, Jul 28, 2014 at 2:33 PM, Edward Manning wrote: > I wrote this code, but it seem to work fine if I only have one ip in the > file. When I have more than one

Re: gethostbyaddr()

2014-07-28 Thread Chris Kaynor
On Mon, Jul 28, 2014 at 2:33 PM, Edward Manning wrote: > I wrote this code, but it seem to work fine if I only have one ip in the > file. When I have more than one IP in the file > > I get a error. Does anyone have an idea why. > It would be helpful to know what the error you are getting is. It

gethostbyaddr()

2014-07-28 Thread Edward Manning
I wrote this code, but it seem to work fine if I only have one ip in the file. When I have more than one IP in the file I get a error. Does anyone have an idea why. import socket def main(): # get file names infileName = input ("What file our the IP adderss in? ") outfile

Re: problem with gethostbyaddr with intranet addresses on MAC

2008-01-28 Thread Sion Arrowsmith
mport * >>>> x = gethostbyname('google.com') >>>> x >'64.233.167.99' >>>> gethostbyaddr(x) >('py-in-f99.google.com', [], ['64.233.167.99']) >>>> e = '192.168.4.123' >>>> gethostbyaddr(e) &

Re: problem with gethostbyaddr with intranet addresses on MAC

2008-01-25 Thread Vladimir Rusinov
4 (#1, Oct 18 2006, 10:34:39) > [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> from socket import * > >>> x = gethostbyname('go

problem with gethostbyaddr with intranet addresses on MAC

2008-01-25 Thread shailesh
lp", "copyright", "credits" or "license" for more information. >>> from socket import * >>> x = gethostbyname('google.com') >>> x '64.233.167.99' >>> gethostbyaddr(x) ('py-in-f99.google.com', [], [&#x