Connect with us


How to Edit Hosts File?




What is Hosts file?

The HOSTS file is a basic text file that holds the IP addresses parted by at least one space and then a domain name, with each entry on its particular line. The hosts file is used by an operating system to map hostnames to IP addresses.

The hosts file is a common fragment of an operating system’s Internet Protocol (IP) application, and aids the task of interpreting human-friendly hostnames into numeric protocol addresses, called IP addresses, that classifies and pinpoint a host in an IP network.

How to Edit?

In the hosts file, you have to enter the domain name and its IP address. Once you enter the domain name in your browser and press enter, your browser will first examine the domain name in the hosts file and after it discoveries the appropriate entry, it will unnervingly map your browser to that specific host name.

For instance, let’s suppose that we want to alter it in such a way that if we typed in “”, instead of going to Facebook we would go to “”. In order to do this we need to treasure out one of the IP addresses of Google and map to that IP address.

Let’s say that one of the IP addresses for Google is If we wanted to map Facebook to that IP address we would add an entry into our HOSTS file as follows:

It is also essential to note that when we enhance records on our HOSTS file they spontaneously become operational. There is no need to reboot or enter additional command to start using the records in the HOSTS file.

Where to Find?

Every operating system has a different host file location. Here are the locations for some popular operating systems:

  • For Windows OS users- C/Windows/System32/drivers/etc/hosts
  • For LINUX/UNIX OS users- /etc/hosts
  • For Apple- System Folder: Preferences and in the System Folder itself.

The Ping Command

Well, you must be pondering how to discover the IP address of a specific domain name. By means of the Ping command, you can catch the IP address of any domain name you require. But for doing this you need to be connected to the Internet. First, you have to open a command prompt (Open Run, Type “cmd” and press Enter). Now type “ping {domain-name}” and press enter and it will display the IP address.

For example, let’s assume that we have to find the IP address of “”. Then open command prompt, it would be displaying something like this:

C:\Users\User Name>

Now type the ping command along with the domain name.

C:\Users\User Name>ping

Press Enter and the IP address of the desired domain name will pop out on the screen i.e. something like

How can we have Fun? 

Find the IP address of the desired domain name. Then get access to the system’s Hosts file and all you need to do is add an entry into the file.

Suppose the IP address of com is Then the record you need to enter in the Hosts file is:

Now every time someone will try to open from that system, spontaneously will be loaded.

Real Life Application

As you can perceive the HOSTS file is a potent tool if you recognize how to use it. There are a various purposes as to why we would want to customize a HOSTS file and some of them are:

  • Network Testing
  • Possible Escalation of Browsing Speed
  • Block Spyware/Advertisement Networks

Robert lives in Texas and works from home due to certain family commitments. He is the gem of a person, and an expert in covering the local news. Due to his expertise in the general news, he writes for the Headlines column of He has immense experience in print media. He has been with the team ever since the website was started.

Continue Reading
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Get in Touch!

Get in touch with us at [email protected], and wait for 24 to 48 hours for the response!

Recent News