What Is the Purpose of Hosts File in Linux Mint 21
Host file as mentioned above contains the IP addresses and hostname of the Linux system, but there are multiple uses of host file and those are:
- Blocking any websites
- Remotely accessing any Alias
- Blocking advertisers and trackers
- Testing an application
- Adding or blocking specific networks
How to Edit the Hosts File in Linux Mint 21
The process of editing the host file of Linux Mint 21 is quite easy; open the host file on your Linux Mint 21 by using any terminal-based text editor, for example, nano:
Now edit the host file by entering the data like IP addresses and host names for the connections you either want to block or access.
How to Block a Website through Hosts File
When it comes to security or parental control hosts file plays a crucial role as it can be used to block unwanted websites. The process of blocking a website is mentioned below:
For instance, if you want to block YouTube then use:
Next save the file and open the website on the browser of Linux Mint to see if the site is blocked or not:
Conclusion
Host files in an operating system generally contain the IP address and the domain name of that system, there are multiple uses of a host file which can be achieved by editing it and it can be done by stating its path with nano command.