How To Edit Hosts File
Hello Friends! Today we are talking about ‘hosts file’ it’s used and how to edit hosts file in windows. Host File is a special type of file by which you can map any domain to any IP address. You can block any type of site in your local system and also redirects a request of opening a domain to the other domain.
Before jumping into this I tell you about DNS (Domain Name System). You know, a server isn’t understood any domain name they understand only IP’s. So, the server uses DNS to convert a domain name into IP and vice versa. Opening a website with it’s IP address is quite difficult because we can’t remember IP’s. That’s why we use DNS.
The hosts file is a simple readable text file and by doing some changes on it we can do some task like assigned a local domain name, redirecting a website to another domain, blocking a website, create website shortcuts also.
Let see some examples of it. First, you have to open your system’s hosts file and this hosts file is present on the given location:- C:\Windows\System32\drivers\etc. So, here is your hosts file exists.
It’s an operating system file. So, to edit this file I used here notepad++ software you can also download this software by clicking here.
As you can see here I opened this file to my notepad++ editor.
I show you here the first example I said assigned local domain name. So, Friends you see here when I type my router’s IP address then chrome shows me the router’s page.
But after doing some changes we don’t have to type it’s IP address to open this router page. We can open this page by typing any name, which is given by you. So, Open your hosts file and at last, type your router’s IP and the domain name which you wanted to give this IP and do save.
This will open the router’s page whenever I type gaurav.com You can see here when I type gaurav.com then it opens my router’s page and asks me the details.
If you want to add two or more details then just type same lines and the domain name which you wanted to give and do save.
So, It will also open the same router’s page whenever I type any of the domain names.
Hope, you like this post. I will share you remaining other examples with you in my next posts. I will upload the next part of this soon. To see more interesting stuff like this then click here.