in reply to Change IP-address and computer name on Win32

First of all, computers don't have IP addresses. Interfaces have them. A computer typically has more than one interface, and an interface can have more than one IP address. Furthermore, more than one interface can have the same IP address (for instance, most computers with a TCP/IP stack will have a loopback interface, with 127.0.0.1 as IP address).

And yes, you can change the IP address of an interface. After all, when your machine comes up, the interfaces won't have an IP address. It's often set during, or shortly after the boot sequence.

The same with the name of a computer. It's something that's set during the boot process. On Unix computers, you'd use the hostname command for that.

There's no standard way of setting hostnames or IP addresses in Perl. The easiest way of doing so would be to call an external program. On Unix, you'd call ifconfig (and check your systems manual for its options, it varies from system to system) to set an IP address, and hostname to set a hostname.

On Windows, you call something else.

Abigail

  • Comment on Re: Change IP-address and computer name on Win32