How to get IP address
Nagy László Zsolt
nagylzs at freemail.hu
Mon Mar 3 03:49:37 EST 2003
> I'm still lost :) How are you getting the hostname dynamically? The
> hostname is assigned during the install of the OS. Changing this (on
> windows) will require a reboot. Where I work, every machine is DHCP,
> but they all have hostnames assigned to them when windows is installed.
This machine is a firewall. One side is connected to the internal
network. It has address 192.168.1.1 and a fixed hostname 'arwen'.
The other side is an ADSL connection. I get the IP address every time I
connect. That IP address has one or more DNS names assigned.
This computer is a multi-hosted machine. It has more than one IP
addresses. You can see that gethostbyname('arwen') returns '192.168.1.1'
because the host 'arwen' is 192.168.1.1 in my local network. But I need
to determine the external IP (that connects directly to Internet).
In windows, you can set the computer name which is not the same. It is a
name of computer in Microsoft Windows Network.
I hope this helps.
Laci 1.0
More information about the Python-list
mailing list