This repository contains a Python script designed to automatically update the hosts file on Windows systems. The script fetches a list of hosts from a remote server and updates the local hosts file accordingly. This ensures that the latest host configurations are applied without manual intervention. This tool is ideal for users looking to automate the management of their hosts file, ensuring it stays up-to-date with minimal effort.
- Automated Fetching: Retrieves the latest hosts list from a configurable remote URL.
- Logging: Detailed logs are maintained to track update history and any errors encountered during execution.
- Python libraries:
requests
- Clone the repository to your local machine.
- Install the required dependencies using
pip install -r requirements.txt
. - Update the
main.py
file with the appropriate values. - Run the script using
update.bat
or typepython main.py
on terminal (Note: Administrator privileges are required). - The script will fetch the hosts list from the remote URL and update the local hosts file.
The script can be configured editing following variables:
URL
: The URL from which the hosts list will be fetched.HOSTS_PATH
: The path to the local hosts file on the system.
Contributions are welcome!
For feature requests, bug reports or submitting pull requests, please use the issue tracker