How to Edit Hosts File in Linux?
To edit the hosts file in Linux, follow these steps to edit the Linux host files:
Step 1: Open a terminal ( Ctrl+Alt+T )
Step 2: Run Text Editor with Administrative Rights by typing following command, you can replace “nano” with your preferred text editor
sudo nano /etc/hosts
Step 3: Enter your Admin password.
Step 4: Edit the file entries in the format “IP_address domain_name”.
Step 5: Save the file, Changes are now applied.
How To Edit Your Hosts File On Windows?
The operating system generally uses a host file to establish a connection between domain names and IP addresses before it goes to the domain name servers. However, sometimes it is required to host files on Windows, MacOS, and Linux to prevent any malicious attack.
In this article, hands-on practice is demonstrated for a better understanding of editing the host file on Windows, MacOS, Linux
Contact Us