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
1 answer
43 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 ...
user avatar
  • 21.6k
0 votes
1 answer
42 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 ...
user avatar
  • 21.6k
0 votes
0 answers
11 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 ...
user avatar
1 vote
0 answers
23 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 ...
user avatar
  • 170
0 votes
0 answers
101 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 ...
user avatar
2 votes
0 answers
27 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 ...
user avatar
  • 151
4 votes
1 answer
127 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
0 votes
1 answer
118 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
28 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 ...
user avatar
1 vote
1 answer
122 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 ...
user avatar
1 vote
1 answer
171 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-...
user avatar
  • 13
0 votes
0 answers
26 views

How do I access my web app on other devices in my environment using some custom domain without using external DNS?

I have a android mobile phone whose hotspot I am using to connect all my devices to this network. I have also hosted a webapp on my laptop which is accessible by all my devices in the local ...
user avatar
1 vote
1 answer
640 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. ...
user avatar
1 vote
1 answer
153 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....
user avatar
  • 383
0 votes
1 answer
77 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....
user avatar
  • 1
0 votes
0 answers
43 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 ...
user avatar
  • 101
1 vote
1 answer
82 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 ...
user avatar
  • 11
1 vote
1 answer
114 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. ...
user avatar
  • 131
0 votes
0 answers
159 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 ...
user avatar
  • 355
1 vote
1 answer
661 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....
user avatar
  • 5,890
1 vote
1 answer
68 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'...
user avatar
  • 131
3 votes
2 answers
553 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....
user avatar
  • 263
0 votes
1 answer
340 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 ...
user avatar
  • 320
0 votes
2 answers
75 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 ...
user avatar
  • 255
1 vote
0 answers
33 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 "...
user avatar
0 votes
0 answers
48 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 ...
user avatar
1 vote
1 answer
2k 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 ...
user avatar
  • 207
0 votes
0 answers
259 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 ...
user avatar
  • 177
0 votes
2 answers
177 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 ...
user avatar
0 votes
1 answer
87 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 ...
user avatar
  • 190
1 vote
1 answer
715 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 ...
user avatar
  • 111
1 vote
1 answer
1k views

How to make changes to Mac OS hosts file take effect?

I frequently edit my /etc/hosts file to block access to distracting websites when I'm trying to work (e.g. I'll add a line like 127.0.0.1 www.nytimes.com). Until recently, changes to the hosts file ...
user avatar
  • 113
2 votes
4 answers
603 views

Force Windows 10 to always open hosts file with Notepad++

The Windows hosts file does not have an extension so Windows 10 by default does not allow creating a permanent association with a program. How can I open the hosts file with Notepad++ without Windows ...
user avatar
  • 1,856
1 vote
1 answer
62 views

Overriding a CNAME within a CNAME chain works on Ubuntu but not Windows

Best practices aside (not having CNAME chains), I am curious to know why this is happening. I have the following: CNAME subdomain.example.com -> CNAME other.example.com -> A 172.17.0.1 If I wanted ...
user avatar
1 vote
3 answers
23k views

My host file is not working on Windows 10

This is crazy, I've never has this issue until now...I like to use the hosts file to block certain websites. But for some reason my hosts file is not blocking any website. I went over this post (Hosts ...
user avatar
  • 13
0 votes
0 answers
75 views

What is the most effective way of remotely controlling the hosts file?

I need to control the hosts file on other Windows machines. I have administrator access on those machines and can install anything, the only question is — what to install? Ideally I would simply make ...
user avatar
0 votes
1 answer
1k views

Unable to unblocked the sites in Hosts File

I blocked some site in Hosts File, but when I tried unblocking it by deleting the indicated sites. I'm still unable to access the sites. Can anyone help me with this? I blocked the sites by using ...
user avatar
1 vote
1 answer
83 views

Redirect website url to a different url of that website (hosts)

I am unsure if this is possible. I am trying to use the Window's hosts file to redirect the address www.youtube.com to music.youtube.com. When I ping youtube.com, I am returned with this IP: 172....
user avatar
  • 175
1 vote
0 answers
144 views

Identify DNS queries that get resolved by HOSTS file

How can I identify DNS lookups that are resolved by my HOSTS file? Over the past month or so, I've begun experiencing long delays involving content stored on SharePoint Online, affecting Word, Excel ...
user avatar
0 votes
0 answers
30 views

Windows redirects folders shares

I don't know if I'm writing my question in the right place, but, here it goes. My company owns a Windows Server 2012 R2 which shares some folders through our network. We're trying to access it ...
user avatar
1 vote
0 answers
24 views

Windows 10 hosts file only recognizing one redirect

In my hosts file I have a.b.c.d website1.com a.b.c.d website2.com Website 1 works just fine, redirecting me to the new website. Website 2 does not. It sometimes tells me that the connection is ...
user avatar
  • 131
0 votes
1 answer
115 views

“/etc/hosts” hostnames ignored and searched instead in Safari and Chrome

I added the local url data 192.168.33.11 core-fine.local into /etc/hosts, saved the file and for a time I was able to serve and see a local website powered by Vagrant. It was all working just fine ...
user avatar
  • 173
-1 votes
1 answer
131 views

How to edit hosts file in Windows 10

www.somesite.com can be accessed only through add-ons VPN.  How can I add it to the hosts file in Windows 10, so it can be accessed without using a VPN? The IP address has multiple domain names ...
user avatar
  • 1
5 votes
1 answer
499 views

`.dev` TLD resolves to 127.0.0.1

My Mac (Mojave 10.14) is unable to access any website with a .dev domain name, such as get.dev. I tried running $ ping get.dev and got the following output: PING get.dev (127.0.0.1): 56 data bytes 64 ...
user avatar
1 vote
1 answer
1k views

Binary zeros in c:\windows\system32\drivers\etc\hosts

The file c:\windows\system32\drivers\etc\hosts on my Windows 10 machine contains 43 binary 0 and nothing else. I did not edit the file in past. The modification time is a day ago. The machine has not ...
user avatar
2 votes
1 answer
2k views

Does adding too many entries to the hosts file causes internet slow down?

I just wanted to clarify one thing, Does adding too many entries to the %windir%/system32/drivers/etc/hosts causes internet slow down? Does duplicate hosts entry slows down browsing performance? ...
user avatar
3 votes
1 answer
15k views

Can a host file DNS entry point to multiple Ip addresses?

Can a host file DNS entry point to multiple Ip addresses ? basically i want have to ad servers , but no balancer due to port issues , the solution i think is host file entry ,but can one dns point ...
user avatar
1 vote
1 answer
1k views

Windows 10 took long time to resolve host names

The problem I've encountered happens since 1809 update. This is some of the description of what happened: My Windows laptop can connect to Wi-Fi networks. When I connect to it, this happens: The ...
user avatar
  • 113
0 votes
1 answer
1k views

How to edit the hosts file in MS Windows 10 [duplicate]

I am looking for a step by step instruction on how to edit the hosts file in MS Windows 10. To edit this file you need to have admin rights, which I have. I tried via MS Windows Explorer. This tool ...
user avatar
  • 717
36 votes
2 answers
20k views

I can't visit websites that have “.dev” domain

I'm trying to visit websites like https://get.dev, but instead of loading website, there appears "Resolving host" message and then I'm getting "This site can’t be reached get.dev’s server IP address ...
user avatar
  • 1,571

1
2 3 4 5
8