This section provides a tutorial example on how to assign host names to computers on a crossover cable network.
Now my two computers are fully connected and working. But I have to address them by IP addresses,
192.168.0.1 or 192.168.0.2, when using any communication programs. Can I assign host names to my computers,
and associate IP addresses with them? The answer is yes. Here is how:
1. On the laptop, go to Start > Control Panel > Systems. The "System Properties"
dialog box shows up.
2. Go to the "Computer Name" tab and make sure "laptop" is in the computer name field.
3. Edit file c:\windows\system32\drivers\etc\hosts to add an entry for the desktop computer:
127.0.0.1 localhost
192.168.0.2 desktop
4. On the desktop, go to Start > Control Panel > Systems. The "System Properties"
dialog box shows up.
5. Go to the "Computer Name" tab and make sure "desktop" is in the computer name field.
6. Edit file c:\windows\system32\drivers\etc\hosts to add an entry for the desktop computer:
127.0.0.1 localhost
192.168.0.1 laptop
7. Open a command window and run the ping command:
>ping laptop
Pinging laptop [192.168.0.1] with 32 bytes of data:
Reply from 192.168.0.1: bytes=32 time<1ms TTL=128
...
8. On the laptop, open a command window and run the ping command:
>ping desktop
Pinging desktop [192.168.0.2] with 32 bytes of data:
Reply from 192.168.0.2: bytes=32 time<1ms TTL=128
...
This is good. I don't have to remember the IP addresses now.