This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Stijn.Hoop
Recipients BreamoreBoy, Stijn.Hoop, ankitoshniwal, dfranke, loewis, mcjeff
Date 2013-04-16.10:35:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Still seeing this on Fedora 18 / Python 2.7.3.

I only have loopback in /etc/hosts

[TUE\shoop@pclin281] <~> cat /etc/hosts   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

I search in and

[TUE\shoop@pclin281] <~> grep search /etc/resolv.conf 

Hostname -f reliably returns as it should

[TUE\shoop@pclin281] <~> hostname -f
[TUE\shoop@pclin281] <~> hostname -f

But socket.getfqdn disagrees, even with itself when run multiple times:

[TUE\shoop@pclin281] <~> python
Python 2.7.3 (default, Aug  9 2012, 17:23:57) 
[GCC 4.7.1 20120720 (Red Hat 4.7.1-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.getfqdn()
>>> socket.getfqdn()
>>> socket.getfqdn()
>>> socket.getfqdn()

Note that is in fact also a valid DNS entry, but not one that I would expect the function to ever return given the search order.
Date User Action Args
2013-04-16 10:35:25Stijn.Hoopsetrecipients: + Stijn.Hoop, loewis, dfranke, mcjeff, BreamoreBoy, ankitoshniwal
2013-04-16 10:35:25Stijn.Hoopsetmessageid: <>
2013-04-16 10:35:25Stijn.Hooplinkissue5004 messages
2013-04-16 10:35:24Stijn.Hoopcreate