Skip to main content

Questions tagged [hosts-file]

The "hosts file" is a common tool in operating systems to map names to IP addresses. These mappings usually take precedence over the DNS system.

Filter by
Sorted by
Tagged with
0 votes
0 answers
62 views

Does a HOSTS file block a url even if it's called from inside a web page?

I edited the hosts file to include: 127.0.0.1 example.com # just an example of course I then used Firefox to go to a site that hosts ads from example.com and I still saw those ads, and ...
ispiro's user avatar
  • 1,581
3 votes
0 answers
89 views

Program bypasses file security settings

I'm trying to block a website with the hosts file, so programs need to be able to read the file for the blocking to work. Editing the file is easy. The blocking works just fine at first. Then when I ...
Migit's user avatar
  • 111
5 votes
1 answer
1k views

Why does Firefox refuse to load sites if there is an entry in the ‘/etc/hosts’ file in macOS 14.4.1 (Sonoma)?

If I make an entry in /etc/hosts for a site, Firefox (v125.0.3) refuses to load the site. I'm running macOS 14.4.1 (Sonoma). The entry in the /etc/hosts file is: 93.184.215.14 example.com www.example....
Eaten by a Grue's user avatar
0 votes
0 answers
68 views

How to safely change /etc/hosts file type from Unicode to ASCII on mac

I need to block some websites in hosts. But it didn't work, after modifying the file, I found it's in UTF-8 format instead of ASCII thanks to OSX Sierra hosts file is ignored How to safely change /...
CherryFlakes's user avatar
1 vote
2 answers
107 views

What happens when the hostname in a Windows 10 hosts file is an IP address?

Bit of a preamble: I've recently decided to play Assassin's Creed: Director's Cut on my Windows 10 PC. However, the game seemed to regularly freeze, making it unplayable. Based on my searches across ...
denabedu's user avatar
0 votes
1 answer
225 views

Hosts file comment format

I'm reviewing a hosts file on a windows machine and I noticed that in addition to obvious comments that start with a # character, it also has lines that are comments but start with two tabs (or in ...
Peter M's user avatar
  • 1,261
2 votes
2 answers
406 views

Disabling or Limiting Tor Functionality in Brave Browser on macOS

I'm seeking guidance on how to disable or limit the Tor functionality within the Brave browser on my macOS system. While I appreciate the privacy aspects that Tor integration provides, I have specific ...
Pedro Delfino's user avatar
0 votes
1 answer
263 views

dnsmasq reads addn-hosts config but ignores it, falls back to system's /etc/hosts

I'm running dnsmasq installed as a NetworkManager plugin on Fedora 39 machine My configs are: /etc/dnsmasql.conf (default, nothing changed): user=dnsmasq group=dnsmasq interface=lo bind-interfaces ...
vrs's user avatar
  • 101
0 votes
1 answer
964 views

Unknown entry in Hosts file (Windows) for geoip.pango-paas.co

I was going to add an entry in Hosts file to make it easy to connect with a server. But when I opened the C:\Windows\System32\drivers\etc\hosts , I saw an entry for (changed the real ip to xx below): ...
dev's user avatar
  • 1
0 votes
2 answers
259 views

Can I block a whole subdomain with one single localhost line?

I need help with my localhost file, I'm kind of confused & not used to this! I'd like to block a website, let's say google as a first example. google has multiple top level domains (.com, .fr, .co....
I'm Dumb And Curious's user avatar
0 votes
1 answer
550 views

How to properly modify host file?

I was able to modify my host file on my Windows 10 laptop by copying it onto my desktop, modifying it and then pasting it back to the system32/drivers/etc folder. I'm doing this to prevent me from ...
Jason's user avatar
  • 145
-1 votes
3 answers
3k views

Hostfile is not blocking this website why?

I am trying to block this website https://example.com/en/b9ah using the hosts file. I went to file explorer, This PC, Selected Windows, System32, drivers, Etc, Host File, copied host file and pasted ...
user avatar
2 votes
1 answer
578 views

/etc/hosts blocks instead of redirecting

I'm trying to redirect Facebook to localhost on Mac OS Ventura. This is my /etc/hosts hello procrastinator...% ...
mircealungu's user avatar
-1 votes
1 answer
219 views

/etc/hosts : Block the Entire Website but Enable One Folder

The below entry in C:\Windows\System32\drivers\etc\hosts file will block the site www.rauf.com. 127.0.0.1 www.rauf.com That's fine. Now I'm looking for more advanced control just with this file. I ...
Rauf's user avatar
  • 3,717
1 vote
1 answer
2k views

Change in 'hosts' file responds to ping but refuses to connect on any browser

I'm currently working on a project where I need to emulate the live site's URL's in order to properly communicate between the projects site, projects browser extension, and the projects database. To ...
Zane Wilson's user avatar
1 vote
1 answer
1k views

How to whitelist websites (not blacklist) in hosts files?

I'm trying to make it easy to avoid random distracting websites. I'd like to have my host file set up to only allow a few websites. Everything else should be blocked. I can't get this to work. This is ...
Sylvia's user avatar
  • 137
0 votes
1 answer
462 views

Unable to delete entries in host files

I added too many hosts file entries such that now my whole computer lags and freezes, my Chrome cannot load any websites, and my computer says that my Wi-Fi has no internet although other devices ...
DingHang's user avatar
1 vote
1 answer
1k views

how to block websites without using host file

I'm just trying to create a basic program that allows users to input websites to be blocked but editing the host file does not work at all. I tried using all the links from here for sites like reddit/...
HowePersonal's user avatar
1 vote
1 answer
1k views

How to block a website like crazygames.com?

I am trying to block crazygames.com website using the hosts file but it doesn't work. I added this line into the hosts file. 127.0.0.1 crazygames.com Pinging crazygames.com [127.0.0.1] with 32 bytes ...
hunko's user avatar
  • 13
0 votes
1 answer
36 views

Why can't I reach test.example.com from my browser, but ping in CLI can

I just want to test my CA engine from Hashicorp Vault. I've spinned up a local NGINX webserver in docker referring to test.example.com. Unfortunately I'm not able to reach it from my browser with that ...
Lucas Scheepers's user avatar
0 votes
1 answer
2k views

web browsers are not picking up my web server via the hosts file, but they pick up my web server on 127.0.0.1

I run a web server e.g. python -m SimpleHTTPServer 80 or python -m http.server 80(which of those depends on python version), and I do echo blah >index.html to write an index.html with the text ...
barlop's user avatar
  • 24.3k
0 votes
1 answer
862 views

why does it take chrome two minutes to pick up that a domain has been specified/blocked in the hosts file, and can that time be decreased a lot?

I'm specifying certain domains in my hosts file to block them. So redirecting a domain to 127.0.0.1 when i'm not running any web server on 127.0.0.1 will block that domain. why does it take chrome two ...
barlop's user avatar
  • 24.3k
0 votes
0 answers
513 views

Locally map or redirecting an URL to another URL for the client side?

Is it possible to redirect an URL to another URL, for the client only. As example. Let's say, I type this in the URL browser https://google.com/this_page_does_not_exist/it_doesnt_exist it just gives ...
karl-police's user avatar
1 vote
0 answers
129 views

Is there a way to detect when a domain is caught by the Hosts file?

On Windows, I use the etc/hosts file to block some domains, for example because they are often used to serve ads. But sometimes, a program tries to connect to a blocked domain for a legitimate reason ...
ETL's user avatar
  • 381
3 votes
1 answer
2k views

Localhost addresses stopped working after installing Docker

I am used to develop with Vagrant. My Windows hosts file uses multiple addresses mapping which used to work just perfect: 127.0.0.1 whatever.local But after installing Docker Desktop, they have ...
Álvaro Franz's user avatar
2 votes
0 answers
157 views

Can I force a web proxy to use a specific IP address for a hostname?

Background: I want to test a site on Akamai's staging network. This usually requires you to find out the IP address of the specific edge hostname and then change your local /etc/hosts file so the ...
bellackn's user avatar
  • 151
4 votes
1 answer
1k views

What's the difference for a hosts file when deciding to use 127.0.0.1 or 0.0.0.0?

Since 0.0.0.0 matches any address and 127.0.0.1 is localhost, when deciding whether to choose one or the other to map unwanted IPs and domains in a hosts file, when is each best? I read that in terms ...
user avatar
4 votes
2 answers
4k views

how to block subdomains using host file in windows

I have seen that I can block access to web pages with the host file: 127.0.0.1 www.facebook.com how can I block all subdomains? *.facebook.com
user avatar
0 votes
1 answer
101 views

Blocking single webpage of a website

I want to block google homepage, but want search result by typing keyword in browser's search bar. I tried extension and host file approach, but it will make all of google in-accessible. So I don't ...
user146551's user avatar
1 vote
1 answer
430 views

"# Auto-generated hostname. Please do not remove this comment." Why not?

In CentOS (but possibly other distros), /etc/hosts has the following comment: # Auto-generated hostname. Please do not remove this comment. Since the comment itself asks not to be removed, it seems as ...
Aaron Cicali's user avatar
1 vote
1 answer
829 views

why is Editing Hosts file for redirecting to IP of my choice giving a 404 error

i edited the hosts file in Linux at etc/hosts where i put two entries at the end as 127.0.1.1 brij-Latitude # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-...
Brijraj's user avatar
  • 13
4 votes
1 answer
4k views

Some websites bypass hosts file in Safari

I downloaded a hosts file from a Github which lists all porn websites, in order to block them on my computer. This works well with Chrome, unfortunately on Safari some websites are not blocked at all. ...
nikos974's user avatar
3 votes
1 answer
602 views

How does linux resolve wildcard locahost subdomains (e.g. : `ping test.localhost`) when `test.localhost` does not exist in /etc/hosts or dns server?

For example in ubuntu 20.04 LTS where the /etc/hosts file is empty: >>> cat /etc/hosts 127.0.0.1 localhost ping still works for any subdomain of localhost: >>> ping test....
Greg's user avatar
  • 533
0 votes
1 answer
513 views

How to block specific websites in a specific browser?

I want to block Youtube in Chrome and Firefox, but not in Chromium, is there a way to do this? The only solution I found is adding this to the hosts file 0.0.0.1 youtube.com 0.0.0.1 www.youtube....
burny's user avatar
  • 1
1 vote
0 answers
357 views

Can't block site in /etc/hosts

In my /etc/hosts I have added this line to block the www.bbc.com/persian: 127.0.0.1 www.bbc.com/persian I am using Firefox on Antix Linux (Debian), and had no success, the site can still be reached ...
Student's user avatar
  • 111
1 vote
1 answer
389 views

redirect http request for microsoft.com to a local server?

I have been using host file to redirect required outgoing traffic to my localhost normally i would just do something like this in the host file : 127.0.0.1 microsoft.com www.microsoft.com but now ...
Sanders's user avatar
  • 11
1 vote
1 answer
820 views

How do I save my Windows 10 hosts file?

Before someone goes and marks this as a duplicate, please understand that I have tried all of the following: Running notepad as an administrator, editing the file and attempting to save. No luck. ...
jlavallet's user avatar
  • 131
0 votes
0 answers
831 views

Why would a “hosts” file prevent a VPN from forwarding a port?

I would like to maintain my hosts block list while being able to use my VPNs forwarded port service, but have a conflict. I connect to a VPN server that port forwards, and my HOSTS file has only the ...
John's user avatar
  • 415
1 vote
1 answer
2k views

Set-Content : Stream was not readable - trying to understand why and how to more gracefully fail

I have the following line in my PowerShell script (Get-Content C:\Windows\System32\drivers\etc\hosts -Raw) -replace '[\d]+\.[\d]+\.[\d]+\.[\d]+ local.mywebsite.com',"$ipAddress local.mywebsite....
neubert's user avatar
  • 7,222
1 vote
1 answer
193 views

Why doesn't tinder.com redirect to 127.0.0.1 in /etc/hosts?

In my /etc/hosts file in macOS Mojave 10.14.6 I have 127.0.0.1 someotherdistraction.com 127.0.0.1 https://www.tinder.com 127.0.0.1 https://tinder.com 127.0.0.1 www.tinder.com someotherdistraction.com'...
jMan's user avatar
  • 131
9 votes
2 answers
4k views

DNS resolution delay for entries in /etc/hosts

For the purposes of doing web development, I have several domain names specified in my /etc/hosts. These represent several different websites that are being run locally. 127.0.0.1 site1.local 127.0....
leecbaker's user avatar
  • 453
0 votes
1 answer
2k views

/etc/hosts file not properly blocking site in ubuntu

I am trying to block certain sites from my computer (namely, reddit) in order to get some work done. However, modifying the /etc/hosts file seems to have no effect. I am working under Ubuntu 18.04 ...
WNG's user avatar
  • 340
0 votes
2 answers
574 views

How to change result of hostname command

when I issue a hostname command in my Centos 7 server, I get this response: vps.example.com I have changed /etc/hosts file with this: 204.93.xxx.xxx mail.example.com However, when I issue hostname ...
jstuardo's user avatar
  • 327
1 vote
0 answers
37 views

What else can stop me from accessing my WIndows 7 etc/hosts file?

Microsoft have recently rolled out a ridiculous change to Windows Defender which "detects" the deliberate blocking (via the hosts file) of Microsoft and other telemetry domains as an "...
Brent.Longborough's user avatar
0 votes
0 answers
52 views

How can I prevent my computer from accessing thousands of websites?

I'd like to block access to domains from my computer. This is what I tried I tried to use the domain filter in my router, but it applies only the HTTP websites. Any website that relies on HTTPS gets ...
tadon11Aaa's user avatar
3 votes
1 answer
9k views

hosts file but for whole network?

I can't believe I can't find this after an hour of Google. This has go to be simple! On my PC, I edit HOSTS file so say, for example, domain.com goes to local IP 192.168.1.5 Great, that's fine. But ...
bcsteeve's user avatar
  • 299
0 votes
0 answers
856 views

How to visit ssl enabled development website when using hostfile

Pre "ssl required" on domains, to visit a development site on a development computer (Windows), I edit my host file and point the domain to the development server IP address. Which was working ...
Wayne's user avatar
  • 187
0 votes
2 answers
1k views

Windows 10 - Blocking a Website in Hosts File

I have blocked a lot of websites in my Windows 10 OS computer and edited the hosts file located in C:\Windows\System32\drivers\etc. Below is the content of my hosts file: 127.0.0.1 www.facebook.com ...
alyssaeliyah's user avatar
0 votes
1 answer
314 views

Hosts file on OpenWRT router blocks cmd connections, but Chrome still connects

I have OpenWRT installed on a TP-Link Archer C7 router, and have added 0.0.0.0 domain.com to /etc/hosts. This seems to have the desired effect when ping-ing, nslookup-ing or curl-ing that domain on a ...
Kenny83's user avatar
  • 260
2 votes
1 answer
2k views

Windows 10 hostfile url to IP address of machine

Is it possible to use a fixed url to redirect to the IP of my own PC? I use DHCP and I have no problem with it but would like to use an url i.e. "server.local" to reach a web server deployed on the PC ...
breakline's user avatar
  • 121

1
2 3 4 5
8