What is a host file? And What can you do by using hosts files?

Friends In this post you will know what is the host file? I am telling you this because its use is very much in hacking. So, when you are learning advanced hacking, you need to know about hosts file before then. So friends know what the host file is?

What is a host file? And What can you do by using hosts files?@myteachworld.com





READ MORE:

What is a host file?

The host file is a file from any operating system through which you can map hosts names and IPs, Let’s say that you have a local domain name. You can map that domain name to any IP. This is a plain text file, but its use is very high.
To Access Host File
Local Disk C >> Window folder >> system 32 >> driver >> etc folder >> hosts file
Friends, if you want to remember any website we can not remember his ip, To simplify this thing, the DNS (Domain Name System) was dropped because it was needed. With the help of the domain name, we can give a particular ip a name. But you should know that our system only understands the ip of the website and not its name.

What can you do by using hosts files?

You can do a lot by using the host file but here I am telling you about some important work.

  • Block any website
  • Redirect any website
  • Assign local domain name
  • Create websites shortcut

So let’s now know about one by one

Block any website:

If you want to block any particular website in your computer, simply you can block those websites with the help of hosts files.
Let’s know how the website is blocked by the host file’s help.


Step1; First of all you open the host file on Notepad in the Administrator Mode. If you do not open the hosts file on the Administrator mode then you can not save it. 


Step2; After this website you want to block, Simply map that website to your local ip, like all the system’s local ip is 127.0.0.1, then write the website (www.fb.com) in front of it and Save the host file.


For example If you want to block many websites then do this simple
127.0.0.1  facebook.com 
127.0.0.1  gmail.com
127.0.0.1  youtube.com
127.0.0.1  google.com


Now if you open these websites by going to your browser then they will not be open.
So in this way you can block any website without any software.

Redirect Any Website:

How do we redirect the website? With the help of hosts file, Suppose  you want to redirect to facebook.com, on google.com, you may have learned a little bit so that we can do all this by using the ip so let us Step by Step How do you know?


Step1; First of all, we have to redirect google.com to facebook.com.


Step2; So for this you should first know the ip address of google.com and facebook.com,
To know the IP address, open the cmd command prompt and enter the command given below.
For  google  ip = ping -4 google.com
For facebook  ip = ping -4 facebook.com


Step3; IP address of  google (216.58.199.174) and Facebook (157.240.7.35) was detected because of the above command, Now simply open the hosts file. With the help of Notepad (remember notepad opening in admin mode)


Step4; Now let us redirect google to Facebook so simply add the google.com before and after the Facebook IP in the end of the host’s file.


Step5; Now if you open google.com on your web browser then facebook.com will be open.
So in this way we can redirect any website.

Assign local domain name:

You have an ip and if you want to map it to the local domain name (ex google.com, abc.org), then you can do it easily with the help of hosts file.
Let’s see Friends by step by step How can we assign a domain name to local ip, from the help of hosts files.


Step1; First you go to this location, go to windows drive c >> window folder >> system 32 >> driver >> etc folder, you will get a file named hosts.


Step2; Now you have to edit this file with any text editor like Notepad, but you will have to open Notepad in the admin mode,

Step3; When you open the hosts file, you must add a line to the file at the bottom, first write the ip then write a domain name after giving a space, And save the hosts file.


Step4; Now simply open your web browser and enter the domain name(abc.org) in the URL box, you will see that instead of abc.org, google.com will be open on your computer because you used Google’s ip ad in the hosts file.
So friends can we assign local domain names like this.

Create websites shortcut:

 The name of a website is very large. For example, if you want to make a short cut of www.google.com, then you can do it with the help of hosts files very easily.


Step1; First of all , you open the hosts file.


Step2; Now you write google’s ip most end and write any short name like it  g.com.


Step3; Now save the hosts file, and by opening the browser, you enter g.com in the URL box, google.com will be open.


So friends were just that in this article, if you like this post please share it your friends.If you face some problem in any steps please drop your email by going to contact us section of this site. thank you

Leave a Comment