New submission from Petr Sklenář <pskle...@redhat.com>: version: tried python 2.6 on rhel55 tried python-2.7-8 on fedora14
Steps to Reproduce: 1. install machine, have a fixed hostname up to mac address 1.1.1.1 = machine.something.com 2. wait a week or longer when your local dhcp server changes your IP but not hostname 1.1.1.159 = machine.something.com [r...@machine.something.com ~]# host machine.something.com machine.something.com has address 1.1.1.159 ifconfig shows the same 3. gethostbyname(gethostname()) shows wrong IP, the original one Actual results: [r...@machine.something.com ~]# python Python 2.4.3 (#1, Jun 11 2009, 14:09:37) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from socket import gethostname >>> from socket import gethostbyname >>> gethostname() 'machine.something.com' >>> gethostbyname(gethostname()) '1.1.1.1' >>> Expected results: gethostbyname(gethostname()) will return your actual IP, 1.1.1.159 Other: 1.1.1.1 = machine.something.com is added in /etc/hosts in the time of OS installation , then its not changed ---------- components: IO messages: 125298 nosy: psklenar priority: normal severity: normal status: open title: gethostbyname(gethostname()) is wrong when IP is changed versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10821> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com