To set the IP address and hostname in Windows, you typically need to modify the hosts file and configure your network settings. Here's how you can do both:
Modify the hosts File
1. Open Notepad as Administrator:
- Click on the Start menu, type Notepad, right-click on it, and select "Run as administrator".
2. Open the hosts File:
- In Notepad, click on File > Open.
- Navigate to C:\Windows\System32\drivers\etc.
- In the "File name" field, type hosts and click Open.
3. Edit the hosts File:
- Add a new line at the end of the file with the IP address and hostname you want to set. For example:
192.168.1.100mycustomhostname.local
- Save the file (File > Save).
Configure IP Address
1. Open Network Connections:
- Press Win + R, type ncpa.cpl, and press Enter.
2. Select Your Network Adapter:
- Right-click on the network adapter you want to configure (e.g., Ethernet or Wi-Fi) and select "Properties".
3. Configure IPv4 Settings:
- Select "Internet Protocol Version 4 (TCP/IPv4)" and click "Properties".
- Choose "Use the following IP address" and enter your desired IP address, Subnet mask, and Default gateway.
- Optionally, set the DNS server addresses.
4. Save Changes:
- Click "OK" to save the changes and close the dialog boxes.
Additional Tips
- Restart Network: After changing the IP address or editing the hosts file, you might need to restart your network connection or reboot your computer for changes to take effect.
- Permissions: Ensure you have administrative privileges to edit the hosts file and change network settings.
These steps will allow you to set a static IP address and map a hostname to an IP address on your Windows machine.