The hosts file in Windows or any other operating system holds DNS entries for some domain names. When an application tries to connect to a domain name (such as yahoo.com), it first checks the hosts file and if a respective IP address (such as 188.8.131.52) is found then it attempts to connect to that IP address without having to consult the configured DNS servers.
If you want to edit, backup, update, or restore the hosts file in Windows back to its original format, then you can make use of a freeware program called HostsCK. Unfortunately this software is not portable and must be installed on your PC.
When you launch the HostsCK after installing it, you are asked to disable the DNS client service because running this service with a heavily modified hosts file will only slow down your system. HostsCK can disable this service on its own, but it also gives you an option to disable this service manually.
In the HostsCK interface, you can see the current entries of the Windows hosts file on your system. From the toolbar, you can switch the hosts file to the read-only or the read-write mode. Only in the latter mode, it can be edited or updated. You can manually edit it or you can choose to update it by downloading from msvp.org website that contains thousands of entries to block malicious URLs.
By using the various buttons in the toolbar of HostsCK window, you can update the hosts file by downloading it from the internet, you can restore it back to the default file that comes with fresh installation of Windows, you can get the IP address of any domain, you can backup/restore the current hosts file, you can check the hosts file for any duplicate entries to minimize the its size.
You can download HostsCK from https://redisoft.uk/.