How to Modify your hosts file in Linux, Windows, and Mac

Table of Contents

In this tutorial, we will show you How to Modify your hosts file in Linux, Windows, and Mac.

Linux

To modify your host file in Linux first login as root user and edit /etc/hosts by running this command:
nano /etc/hosts
Enter your domain, user, password and make changes.
To save it Press Ctrl+X and answer with Y.

Windows

To modify your hosts file in Windows press Start and search for Notepad software.After founding open this software by Run as administrator.
From notepad open c:\Windows\System32\Drivers\etc\hosts file and make changes.
To save it Press File and Save.

Mac OS X 10.6

To modify your hosts file in Mac open Terminal and type this command to open hosts file.
sudo nano /private/etc/hosts
When prompt type domain, user, and password.
Edit the hosts file and save changes by pressing CTRL+X.When prompt answer Y.
To get effect run:
dscacheutil -flushcache

You have successfully Modify your hosts file in Linux, Windows, and Mac.

Enjoy!

Share on
Facebook
Twitter
LinkedIn
Print
VPSie Cloud service

Unlock Your

20% Discount

The First 3 orders get 20% discount! Try Sign up on VPSie to get a chance to get the discount.