1. Click on the Terminal icon to open the application.
2. After entering the Terminal console, ensure that you are in the top-level folder by typing the command:
cd /
The path to the hosts file on Linux is:
/etc/hosts
To edit the file, you'll need administrative privileges (sudo) and a text editor like Nano. Use the following command to open and edit the file:
sudo nano /etc/hosts
3. When you attempt to open the file, the system will prompt you to provide the administrator's password. Once you enter the password, press Enter to proceed. This step is necessary to ensure you have the required permissions to make changes to the file.
4. Using the arrow keys, move the text cursor under the last written line and add the hostname settings. In your case, you are adding an address with the hostname "my-new-website.com." Therefore, the line should read:
IP_address my-new-website.com www.my-new-website.com
5. To confirm the new changes you made to the hosts file, press the key combination Control + O, and then press Enter. This will save the changes. To exit the editor, press Control + X.