Why does Cryptomator modify my hosts file as shown below?
What is the reason?
NOTE: all lines other than the one modified by Cryptomator start with hashtag (pound) symbol but for some reason it displays here as large bold text.
# 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.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 cryptomator-vault
Thankyou, I read that, but maybe I should have worded my question better. I wanted to know why Cryptomator uses the hosts file at all? Why is it necessary to direct “cryptomator-vault” to 127.0.0.1 (local loopback)? What exactly does this achieve?
I thought the hosts file is used by the web browser to block and/or redirect domains by mapping domain names to IP addresses before an external DNS server is checked. For example blocking adverts, trackers, malware, etc by redirecting them to 0.0.0.0 (unroutable/go nowhere) as used by various blocker hosts files available on the web.
I tried entering “cryptomator-vault” into web browser thinking it would redirect to 127.0.0.1 but it just searches the web. I also entered “cryptomator-vault” into Windows file explorer, that opens Edge browser with an error saying cryptomator-vault refused to connect.
Also, if Cryptomator is acting as a local server surely it would use an IP address other than 127.0.0.1, so what exactly is achieved by redirecting “cryptomator-vault” to local loopback.
I know Cryptomator just works and it’s been created by extremely knowledgable people. I’m just trying to understand it.
WebDAV is an HTTP-based protocol and Cryptomator acts as a WebDAV server accepting so-called loopback connections on your local machine only.
And if you have a local server that you would like to access, you have to use 127.0.0.1 (or localhost or ::1, which are usually defined as well, but all resolve to 127.0.0.1). That’s why I don’t understand what you mean by “it would use an IP address other than 127.0.0.1”.
And as we’ve stated in the release notes, we ran into problems with all of these addresses, because operating systems and applications try to be smarter (or dumber) if they believe they’re accessing something locally.
With the cryptomator-vault alias (to be honest, we could’ve called it anything), operating systems and applications believe that they’re accessing something in a network and stop being smart/dumb. We still don’t know WHY exactly, but we know that it helped all the issues that we’ve addressed in the release notes.
That’s why cryptomator-vault is being added to the hosts file.
Thank you very much for the explanation. I was getting mixed up with it working like a NAS or other device which gets a local IP address from the router NAT usually in the format of 192.168.x.x.