How to Edit Hosts File in MacOS?
To edit the hosts file on macOS, follow these steps to edit the MacOS host files:
Step 1: Open the Terminal application.
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( Ctrl+O ) and exit the text editor ( Ctrl+X ).
By following these simple steps, we successfully edited the host file available on Windows, MacOS, Linux to prevent any malicious attack.
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