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.

learn more… | top users | synonyms

29
votes
8answers
7k views

Browser with its own hosts file?

I have a number of staging and test servers that I need to constantly modify my hosts file to access (they depend on the domain name, so I have to change the hosts file to get them to work). I find ...
0
votes
1answer
93 views

Host file hijack

I wanted to add an entry into my host file so I opened the directory and Hosts Networks Protocol Services All files except the Imhosts.sam file are messed up. all 4 of those files when double ...
1
vote
2answers
3k views

Windows 10 hosts file used by another process

There are a few other question with this same title but they do not solve my problem, so I am opening another one. I have set the permission for the "hosts" file to full access for the current user. ...
1
vote
2answers
32 views

Host file is open in another process

I am trying to edit my host file under C:\Windows\System32\drivers\etc But I keep getting the message The process cannot access the file because it is being used by another process. My PC has ...
6
votes
2answers
3k views

Hosts file changes are not recognized in Windows 8

When i make changes to the hosts file in windows 8, it doesn't work. Although my changes stay in the hosts file. What I'm trying to, is to redirect the domain name riddergarn.dev to 127.0.0.1 with ...
3
votes
1answer
4k views

Editing hosts file to block sites not working

I put these lines in my C:\Windows\System32\drivers\etc\hosts file: 127.0.0.1 www.cnn.com 127.0.0.1 cnn.com 127.0.0.1 facebook.com 127.0.0.1 www.facebook.com 127.0.0.1 www.hotnews.ro 127.0.0.1 ...
0
votes
1answer
36 views

how to block connection to a domain in firefox

i need to utterly block a domain from even being connected to. obviously, addons wont work, since those only check the URL of the site the browser is navigating to, not domains the browser is ...
1
vote
1answer
35 views

Confusion regarding DNS query vs HOSTS file

With the subject, I have windows/linux machine and In which installed virtualbox and setup 192.168.11.19 ip and entry www.abc.com in hosts file. We have setup DNS server/filter on network and setup ...
3
votes
6answers
21k views

With Windows 7, why is an entry in the hosts file not working?

I updated some entries in the hosts file at C:\WINDOWS\System32\drivers\etc. As a test, I decided to make Google point to 127.0.0.1. # Additionally, comments (such as these) may be inserted on ...
0
votes
0answers
14 views

Accessing nginx server when offline

Yo! I've been trying to get nginx to work when I'm offline, but both Iceweasel and Chromium complains about not being able to access the domain. It works just fine when I have Internet access. I'm ...
6
votes
1answer
499 views

Acrylic DNS Proxy not resolving

So I recently had an update issue where I landed up downgrading to Windows 8. As I need to do my work, I have re-installed my XAMPP server as well as Acrylic DNS Proxy. Unfortunately, Acrylic is not ...
2
votes
2answers
739 views

windows 10 hosts file entries been commented out

Windows 10 is commenting out my hosts file entries. This happens periodically so every 1 hour. Although I manage to save the changes but they will be commented out after around 1 hour. I never ...
1
vote
3answers
9k views

Mapping one IP address to another in the 'hosts' file

The hosts file (%SystemRoot%\system32\drivers\etc\hosts) lets you make google.com point to, for example, 127.0.0.1 on your local machine, but what if I wanted to make, say, 192.168.1.5 point to 127.0....
1
vote
0answers
122 views

Replace / Edit host file with windows BAT

I wish to add and remove some lines in host file within a period of time (Time setting will be done via task schedule job) I can create two BAT file, one for adding new lines and one for removing ...
2
votes
3answers
471 views

Alternative to 127.0.0.1 in hosts file

I have a bunch of websites blocked at the system level in my Windows 7 by using the etc/hosts file. So far, I've done it the usual way, by giving 127.0.0.1 as the website's IP address. However, I'd ...
1
vote
1answer
54 views

Windows 7 PC, Google blocked. All other sites OK

All google sites seem blocked with "This page can't be displayed" Error. I can ping all the google servers but even trying the IP doesn't work. Same message. I have checked hosts files. I have done ...
9
votes
2answers
5k views

Hosts file location in Windows 7

I know the hosts file should be under C:\Windows\System32\drivers\etc\ But for some reason, I don't have the etc directory there at all. In fact, I searched for "hosts" under C:\Windows and found ...
0
votes
0answers
56 views

Ever since upgrade to Windows 10, Firefox 45 and Chrome 49 just loop when override with hosts file entry

The standard method of developing dev sites, or accessing temporary old sites after moving them is to place an entry into c:\windows\system32\drivers\etc\hosts - just like /etc/hosts on UNIX machines. ...
-1
votes
1answer
34 views

Is it possible to set Windows 10 so that it ignores DNS servers and only uses the hosts file?

As in the title? What I want is to make it only allow Internet access to predefined domains, those explicitly listed in hosts. If it is not possible, is there any other way to make it only allow ...
27
votes
3answers
15k views

Curl local host names on Mac OS X Yosemite

I just upgraded from Mavericks to Yosemite, and now curl can't see loopback host names. Set up a simple http server to test: $ python -m SimpleHTTPServer Serving HTTP on 0.0.0.0 port 8000 ... Now ...
0
votes
0answers
30 views

Apache serving files as plain text

Yesterday I received my Raspbarri PI 3, which I ordered to experiment around. It's up and running with Ubuntu MATE, and connected to the network. Now I've got a few little Django projects (1.9) which ...
2
votes
2answers
175 views

Block (nullroute?) an IPv6 hostname using /etc/hosts

I'm trying to prevent my web browser from communicating with certain hosts (mostly ads and tracking). I have a list of such hosts in my /etc/hosts file. For IPv4 I can do: 255.255.255.255 example....
20
votes
5answers
12k views

Why can't I block Facebook using /etc/hosts on Mountain Lion (OS X)?

It worked for a while in the old configuration, but then stopped working for some reason. Here is my /etc/hosts file from my Mountain Lion MacBook Air: 127.0.0.1 reddit.com www.reddit.com 127.0.0.1 ...
0
votes
0answers
64 views

Password protected host file is not readable

I want to set a password on host file which resides in the windows path windows/system32/drivers/etc/host I could password-protect the file by using winrar and that's not a problem. However, doing so ...
1
vote
0answers
9 views

Automatically rewrite UNC Path (using lmhosts if possible)

I have to VPN into a domain for work. On their internal network, paths are in the format of (for example) work.local\shares\Share\SomeDirectory\SomeFile.ext. When I utilize the VPN, however, I have to ...
1
vote
2answers
53 views

Windows 10 hosts file entries get blocked automatically by # sign after some times

My OS is Windows 10. I have entered a few entries in my hosts file. But after some time or after reboot there is a # sign in the beginning of each entry. I did it using Administrator Account also. ...
5
votes
3answers
17k views

How do I redirect a domain to another domain locally?

My /etc/hosts file looks like this: 127.0.0.1 localhost 10.20.7.67 testsitealpha.dev othersite.dev testsitebeta.dev The first two work. The last one doesn't. Why not? How do I make it ...
0
votes
1answer
64 views

Browsers seems to ignore the hosts file while ping works?

I am trying to make xyz.com always map to google.com (216.58.219.206) on my machine (OS X El Capitan). Made the following changes to the /etc/hosts file: 216.58.219.206 xyz.com I've cleared the ...
39
votes
6answers
21k views

Force Chrome to open URLs as URLs, instead of searching

I have a local Apache server running, which is defined through /etc/hosts as "apache". So I often open pages like: http://apache/website/ Normally, this works fine. However, since I am using a more ...
-1
votes
1answer
41 views

Website gets redirected to 127.0.0.1 occasionally

I am trying to access AirAsia's Web Check-in Page. Occasionally I can access it. However, most of the time I get redirected to 127.0.0.1. Could this be an ISP issue? Details: My hosts file is clean....
1
vote
1answer
111 views

Why does blocking sites through hosts file break HTTPS?

I've recently decided to give this hosts file a try. Just after adding these entries on my machine I've noticed that HTTPS connection is insecure on banking sites and PayPal. Chrome shows a red ...
0
votes
0answers
29 views

Firefox Caching old Hosts file settings?

I have an imac where the family account has no password. Then I have a second account for me which is admin. I keep my dev stuff there etc. I keep my teenager from accessing social media on the ...
1
vote
0answers
46 views

Better to block a host to 0.0.0.0 than to 127.0.0.1?

I have a few hosts that I would like to block in my /etc/hosts file. For that I need to define a bogus IP address that the DNS queries get resolved to. Most of the tutorials I saw so far all mention ...
0
votes
0answers
29 views

Having two IPs for same hostname in hosts file

Request I would like to have my hostname let's say hostA resolve to IP1 if i am at home and IP2 if i am remote Is it possible to have two IPs for the same hostname so that it tries them both and takes ...
0
votes
1answer
113 views

Can I use /etc/hosts file to block ads when using Ubuntu 14.04.3 OpenVPN server?

I have an OpenVPN server hosted on Digital Ocean. I've uploaded a hosts file to the server to help filter a lot of unwanted domains. When using the server, it filters the domains. However, when I use ...
0
votes
1answer
39 views

Win2012 DNS static redirects from C:\windows\system32\drivers\etc\hosts

currently I'm using static redirects to localhost in C:\windows\system32\drivers\etc\hosts for a low level and fast spam, maleware, ad, etc. protection. Since there is a Win2012 DNS-Server around I ...
5
votes
1answer
4k views

Windows 8. Hosts file doesn't work

I am using Windows 8 developer preview (x64) for testing purposes. I want to access some local network resource by DNS. So, I've added next line to my hosts file (%sindir%/system32/drivers/etc/hosts): ...
17
votes
4answers
12k views

Simulate manipulation of the etc/hosts file in Google Chrome

How can I set up Chrome to reference hostname lookups locally and not from the standard etc/hosts file? When debugging a website, it's sometimes useful to set up entries in C:\Windows\system32\...
1
vote
0answers
32 views

Possible to make a program to check Windows hosts file every minute?

I know how to block facebook using hosts file. Problem is that I can just easily edit hosts file and do facebook again. So if there is a program that reports whether hosts file currently contains ...
0
votes
1answer
34 views

Can /etc/hosts or something similar be used to redirect a http URL to a file path?

My Windows 7 admin pushes out some proxy settings (e.g., a proxy.pac file available through http) to my computer every night that I don't want. I have modified this pac-file and stored it locally, on ...
2
votes
1answer
366 views

Cannot access shared drive in same machine uisng machine name but can access using IP

I have 4 desktops running Windows Server 2008 32bit version. I created some shares in all these machines. My program gets files from these machines (like \machine1\abcd). The machine names mentioned ...
0
votes
1answer
43 views

Bizarre domain/host file/browser issues. A real chin-scratcher

I was working on a dev site yesterday (of which I have a modified host file to view) when all of the sudden Chrome stopped being able to load the site. Or the production site (no host file mods ...
-1
votes
1answer
40 views

Can I protect Win7 system file by password

I need to protect the C:\Windows\System32\drivers\etc\hosts file by password. As I know any software can't protect a folder or a file within the Windows folder. Or is there still some way? Or can I ...
0
votes
0answers
102 views

Does Blocklist manager still work and if no, what's an alternative?

Years ago I used a handy program called BlockList Manager. Though the website is still up, I can't find any working download links. I was able to downoad it from this site and run it but the program ...
0
votes
1answer
30 views

Using the command line in order to change hosts/hostnames on Centos

I need to use the command line in order to add a new host resolution on a temporary basis. I use centos. I need a new localhost resolution such as the following: 127.0.0.1 something.localhost ...
2
votes
1answer
112 views

Sending and receiving email messages to localhost with a specific domain name

I need to be able to send email messages to localhost by using another hostname/domain name that localhost. Thus instead of me@localhost I need something such as me@domain.something. (I require a ...
5
votes
2answers
6k views

Hosts file switcher on linux

It appears there are a ton of utilities to manage the hosts file on OSX. I haven't been able to find even one like http://www.macupdate.com/app/mac/29949/gas-mask for linux. I keep my hosts file ...
3
votes
2answers
5k views

Edge browser error 'Hmm, we can't reach this page' loading localhost address

Microsoft Edge presenting error message 'Hmm, we can't reach this page' loading localhost address. Loopback flag is checked. Address mapped in host file 127.0.0.1 www.desenv OS: Windows 10 - ...
13
votes
2answers
2k views

What does this entry in hosts-file mean: 192.168.3.2 NPI2A54EA

I took over a Windows 7 PC from a developer and in the hosts file there was this entry: 192.168.3.2 NPI2A54EB Does anybody know why this would be entered there and if this could be a virus or would ...
4
votes
2answers
912 views

Is there a maxium number of hostname aliases per line in a Windows hosts file?

I have a hosts file on Windows 7 that has an IP address followed by 10 different hostname aliases. I can ping the first nine, but if I try to ping the tenth, I get: Ping request could not find host ...