INFORMATION
A host file is used for mapping an IP address to a domain. it works as a DNS resolver for your own system, it doesn’t require internet to connect to a DNS server for knowing the IP-address for a website.
you can also use it to redirect someone to your website in your network.
for an example: your Local IP is 192.168.43.183
now we will edit host file and type facebook.com google.com
and we will add our IP before it. And whenever we will try to visit google.com or facebook.com, we will be redirected to our local IP.
CONFIGURATION
In Windows,
you will find the hosts file in windows in c:\windows\system32\drivers\etc\hosts
it will look like this :
In Linux(Debian, Ubuntu) and MAC os,
you will find the hosts file in Linux operating system in /etc/hosts
type this command to open the hosts file:
gedit /etc/hosts
EXAMPLE:
add this string to the hosts file: technicalnitesh.com  127.0.0.1
now, run the apache server with this command:
service apache2 start
after running it, go to the browser and visit: technicalnitesh.com
it should have redirected you to the default page of your apache server.
UPDATE: our official hacking course
Thanks For Visiting.