-
Notifications
You must be signed in to change notification settings - Fork 0
Description
OS: Mac (Sonoma 14.4 (23E214))
Overview
If the user has used the hosts file in the past, and has commented out lines it will completely remove them.
Steps to reproduce
- Have an /etc/hosts file with sites that were commented out
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 test.site
#127.0.0.1 inactive.site
-
Open the Hosts Manager
-
Save or change your hosts
Expected behavior
Because I had some sites, I thought it would append new or edits to the sites it did have alongside them, or it would have imported them in an inactive state.
Actual behavior
The hosts file was replaced with the new hosts file, which does contain wrappers on its managed content.
Resolution
I might expect it to append, or respect other possible applications that manipulate the hosts file. And after having it wipe out the contents of the existing file it would have been nice for it to have stashed a copy of it before taking control, either internally or alongside the hosts file.
It does seem to import active sites, so importing and recognizing other styles of commented lines to import other inactive sites might also resolve this.
I think it also wipes out any comments in the file, even if only for informational purposes.