How to Edit Hosts File in Mac OS X and Windows

Author: | Posted in General, Mac, Tutorials, Windows 1 Comment

What is Hosts File:

The Hosts file is a text file which has map hostnames to IP addresses. If you type URL in the browser, it will check the hosts file and if it is located, then it will redirect to the IP which you have provided, otherwise it will go to the IP via DNS server of your active connection.

Windows Host file and mac Host File

The Hosts file is used to block certain hostnames. It can be edited and you can even block host names on your own. Now I’m going to show you how to edit Hosts file in both MAC OS X and Windows Operating System.

How to Edit Hosts File in Mac OS X

Step 1:

Open Terminal from Applications/Utilities

Step 2:
Type SUDO NANO /PRIVATE/ETC/HOSTS and press Enter. Then type the Admin password if asked.

Terminal Hosts editing Mac OS X

Step 3:

Now Hosts File is opened. Tap the Down Arrow key to bring the cursor down and start adding your Hostnames and IP addresses.

Editing Hosts Mac OS X

Step 4:

Press Control+O followed by ENTER/RETURN key to Save the Hosts File. Flush the DNS to take effect. Now you can ping or type the URL in the browser to check.

 

How to Edit Hosts File in Windows

Step 1:

Open My Computer and Navigate to the Primary Partition which consist of Operating System and go to WINDOWS/SYSTEM32/DRIVERS/ETC

Host File in Windows

Step 2:

Copy the Host File to the Desktop to Edit. (You cannot be able to edit the file inside that Folder).

Step 3:

Open the Host file with the Notepad which you copied earlier to the Desktop.

Host File in Windows

 

Step 4:

Add your Hostnames and IP Addresses then Save the File.

Step 5:

Now Copy or Cut the File from the Desktop and Paste it in the Windows/System32/Drivers/Etc. Replace original Host file with the one which you edited. Flush the DNS to take effect. Now you can ping or type the URL in the browser to check.

 

Tips to Consider When Editing Hosts Files

  • You can consider few tips that can be applied to hosts file.
  • You can Redirect your hostnames to desired IP addresses.
  • You can add # symbol to add Comment inside the Hosts file, for future reference.
  • You can Block applications while connecting to some addresses.
  • You can Block websites through Hosts File.

Video Tutorial is embedded for your Convenience. If you have any doubts, drop it in Comment Section.

If you like this post, Share it to your friends. Dont forget to Subscribe our Feeds, Follow us on Twitter, Facebook and Pinterest.

Comments
  1. Posted by android samsung galaxy phones

Add Your Comment

*