Question How do I remove incorrect Hosts File association ?

accesscpu_

Honorable
May 7, 2019
83
4
10,535
For some reason, my Host file has gotten associated with the .ics file extension (and tries to open with Microsoft Outlook/iCalendar). I didn't do this personally, and was a recent thing I've noticed (it usually is just a generic file, which is how it is when Windows is first installed).

How do I locate and remove this association and revert it to default?
 

accesscpu_

Honorable
May 7, 2019
83
4
10,535
In researching, I'm now seeing that this may be the new version that Windows uses. Is the default host file now an .ics extension for Windows 10/11?

Also, which one should I use to block IP addresses?
 
.ics I though was always calendar related stuff.

It would be extremely strange for them to use that extension on the HOSTS file. The problem has always been that the HOSTS files has no extension so you have to force applications to read it and be careful to not save it with a extension.

But who knows microsoft does lots of stupid stuff lately.

I don't know how useful HOSTS file is anymore. From what I have seen if you use encrypted DNS...and everyone should...it seems to bypass the hosts file. I am not sure if it is just the browser based DNS settings or also the ones you can set at the interface level. I know for sure the setting in the browser will bypass the host file I have not tested the OS level ones.

You should be able to rename the file back to HOSTS with no extension or just create a new one.
 

Math Geek

Titan
Ambassador
my win 10 vm has 2 hosts files.

one is the one we expect with no extension and i also have one that is hosts.ics

it looks like the normal hosts file but has no entries. no idea why 2 of them all of a sudden either as i've never really noticed it either. the odd thing is it has been updated as of 2 days ago while the normal one hasn't been changed in 6 months or so.

my guess would be that it's a way for MS to bypass the normal hosts file if it doesn't like what you added to it. just for the fun of it i deleted the .ics version to see if it gets put back by file protection service.
 

accesscpu_

Honorable
May 7, 2019
83
4
10,535
Another quick question. I'm looking to restore my old host file settings, but I now have two versions.

My original one says this:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.

But looks like the newer one (with the .ICS calendar extension) says this:

# Copyright (c) 1993-2001 Microsoft Corp.
#
# This file has been automatically generated for use by Microsoft Internet
# Connection Sharing. It contains the mappings of IP addresses to host names
# for the home network. Please do not make changes to the HOSTS.ICS file.
# Any changes may result in a loss of connectivity between machines on the
# local network.

Which one should I work from? And why the hell would the one that MS generated/hijacked say an older year than the previous (2001 instead of 2009)? I can confirm the top one is a backup of the fresh install from Windows 10.
 
I see microsoft is use the extension ICS to mean two different things.

Then again internet connection sharing is a extremely old thing that only has been partially modernized. It was originally used so you could share your internet connection with other devices back in the day you connected a dialup modem to the pc serial port. 1993 seems about the time people still used dialup.

If we assume the description is correct the host file with the ICS extension should only be used when you are using the connection sharing feature. Not sure that feature has always been a buggy mess.

Again I am pretty sure the new encrypted DNS is bypassing the host files.
 

accesscpu_

Honorable
May 7, 2019
83
4
10,535
UPDATE:

So I Googled how to turn internet connection sharing off (by clicking in the sharing tab in the properties of the internet adapter), but the box was already unchecked. So by all accounts, the host.ics file should not keep regenerating.

HOWEVER...

I only noticed this in the last few months, and about two months ago, I did add a hub/switch to my router to give me more ethernet ports. Possibly related?
 
I guess does this cause you any issues. Generally if the hosts file is blank it does nothing. I still have not found anything that explains the difference between the normal HOSTS file and the HOSTS.ICS file. ICS is very unstable and there are better ways to accomplish this so not a lot of people use it.

Your pc has no idea how many switches etc are connect anyplace in your network. The router lan port are actually a small switch and your pc would have no idea if you added a switch to the router or you just purchased a router with say 8 lan ports.

Switches are almost undetectable even when you intentionally want to find them. More total ports would mean more devices/mac addresses. This though does not tell you how many ports since a device can have multiple mac addresses. Now maybe if you put in 100 switches or something you might be able to detect a slight delay.

BUT none of this matters the host file deals with IP addresses not mac addresses.