Hosts file is blocking access to some websites. How do i put custom HTML instead of default message "This site can’t be reached"?
One has nothing to do with the other.
hosts file is just a "directory" of host names and their IP addresses. It's not limited to websites. You can think of it as a "flat file DNS lookup."
# Sample hosts file # 123.456.789.001 foo.bar
With this address, you can...
- Go to a website - http://foo.bar
- SMB share : smb://foo.bar
- SSH connection:
- Copy files securely from one host to another -
scp stuff.ext email@example.com:/path/stuff
- and much more
In order for your browser to display a web page, it must be "served" that page. Since, by default, your clients aren't running a web server, there's nothing to serve.
I'm assuming that you want to display this "web page" when someone goes to a site you "blocked" by using a custom
You need to do this at the (your) network level where the DNS lookup redirects (or firewall intercepts/redirects) to a server hosting your error page.