Questions tagged [hosts]

host is any machine or computer connected to a network and can offer information, resources, services and applications to users or other nodes in the network.

Filter by
Sorted by
Tagged with
1064 votes
17 answers
1.1m views

How to clear/flush the DNS cache in Google Chrome?

As you probably know Google Chrome has its own internal DNS cache. Is there a way to clear it without having to wait for the time out or close the browser?
Mee's user avatar
  • 10.8k
90 votes
5 answers
218k views

Using wildcards in names in Windows hosts file

Is there a way to create a wildcard domain in the Windows hosts file. I tried this xxx.xxx.xxx.xxx *.somedomain.com This does not work, is there maybe some other syntax I should use? I am ...
Saif Bechan's user avatar
  • 3,315
4 votes
5 answers
16k views

Hosts File not working correctly

I'm having some issues with my hosts file. 127.0.0.1 localhost 127.0.0.1 whatever 127.0.0.1 sub.localhost 127.0.0.1 example.com localhost and whatever both work. However the others have weird ...
acm's user avatar
  • 143
4 votes
5 answers
2k views

Editing the hosts file

I'm looking to edit the Windows TCP/IP hosts file (at c:\windows\system32\drivers\etc\hosts). I'm wondering, what is the best way to do this (on Windows XP)? Let's say that I want to redirect, say, ...
Maxim Zaslavsky's user avatar
4 votes
1 answer
20k views

Why does the hosts file in Windows 10 no longer block YouTube?

The file hosts in C:\Windows\System32\drivers\etc blocks every website, that I put in there except YouTube. It used to block it but no more. There were always workarounds to go on YouTube, if you ...
Paul Erlenmeyer's user avatar
3 votes
3 answers
4k views

Domain blocked in Windows hosts file, but the site is still accessible

I'm trying to figure out why my hosts file isn't being honored correctly. And by correctly I mean, when I visit the website I'm trying to block it takes about 12 hours for it to take effect. And yes, ...
captainentropy's user avatar
9 votes
4 answers
11k views

Unable to block a website through System32/drivers/etc/hosts

I am trying to block social media and news websites on my local machine (Windows 7). I added the below lines into my hosts file: 127.0.0.1 www.thatstamil.com 127.0.0.1 www.facebook.com In that ...
Anto S's user avatar
  • 193
26 votes
8 answers
31k views

Does Firefox ignore the hosts file? How to make Firefox honor the hosts file

I'm using Firefox browser in Ubuntu 18.04. I made an experiment where I want some domain names to be resolved to another IP address than their actual one. Firefox seems to ignore the IP in the hosts ...
user9371654's user avatar
  • 1,207
9 votes
2 answers
84k views

How do I set an alias name in the hosts file?

I have a production server, on which three different application are running. I need to configure aliases for that server, according to which application needs to be accessed by the user. How do I ...
user11222's user avatar
  • 249
3 votes
2 answers
5k views

Windows Script Host Error Dialog Popups in the morning

A few days ago when I resume my computer from sleep mode in the mornings I would see an error dialog from "Windows Script Host" that read: "There is no script engine for file extension ".vbs". I am ...
PPC-Coder's user avatar
  • 131
42 votes
1 answer
78k views

What's the Windows equivalent of "/etc/hosts"? [duplicate]

I can block my little brother from accessing a website on my Mac by adding the following line to my "/etc/hosts" file. 127.0.0.1 someaddictingwebsite.com Do Windows systems have a file ...
David Faux's user avatar
  • 4,829
27 votes
8 answers
72k views

OSX Sierra hosts file is ignored

For some reason, two days ago my hosts file started being ignored. I'm using Mac with Sierra OSx . This is the current content of the /etc/hosts file ## ## # Host Database # # localhost is used to ...
T1000's user avatar
  • 373
7 votes
2 answers
2k views

How can I route a domain to my box at home?

I currently own my own domain, and have been using dyndns.com's "custom DNS" to allow me to redirect 'example.com' to my website at home, which is on a dynamic IP. I've now switched over to a VPS ...
Eddie Parker's user avatar
  • 2,914
6 votes
3 answers
38k views

How can I modify my hosts file? It is read-only and cannot be modified even as Adminstrator.

Does anyone know how to modify entries on the hosts file when it is marked as read-only? I have tried unchecking the Read-only tick box, but I get an Access is Denied error, and I'm running as the ...
Jaime Garcia's user avatar
5 votes
3 answers
6k views

hosts file for ip address

I would like to map ip address to specific localhost interfaces (e.g. 23.45.66.77 => 127.0.3.3). For named hosts I can use the hosts file. Naturally this doesn't work for IP address. This has to work ...
Jon Clegg's user avatar
  • 151
4 votes
1 answer
5k views

Using Proxy Server to act as hosts file

I am trying to see if I can have a specific Hosts file that only a Proxy Server application on my machine will use while the remainder of the machine uses the normal proxy server. For example, I want ...
nopuck4you's user avatar
3 votes
4 answers
69k views

How to edit the hosts in Windows 7?

I would like to add an address to the hosts file. I am running Windows 7 (Hebrew edition), and I am the system administrator. I have tried the command notepad C:\Windows\System32\drivers\etc\hosts to ...
Ruvi's user avatar
  • 31
3 votes
2 answers
2k views

How can I overwrite the hosts file in Windows 7?

I can't overwrite my hosts file in Windows 7. I open Notepad as an administrator and open the hosts file (C:\Windows\System32\drivers\etc) as an administrator. 96.44.181.245 www.Google.com has been ...
ben950's user avatar
  • 722
2 votes
3 answers
73k views

Why is "127.0.0.1 localhost" needed in HOSTS file?

I disabled all my network connections and deleted 127.0.0.1 localhost in HOSTS file but cannot find what had I broken by it. My IIS and MS SQL Server 2008 R2 continues to resolve localhost just fine ...
1 vote
0 answers
1k views

How to redirect a URL to a certain IP, as with /etc/hosts?

Someone on my shared server has messed with some setting such that gethostbyname('www.google.com') (PHP) gives me the IP for his website, rather than Google. I believe this can be done via the /etc/...
mpen's user avatar
  • 12.1k
0 votes
5 answers
2k views

How can I create shorter URLs to sites on my computer?

I was wondering if I could use my Windows 7 hosts file to create shorter URLs for sites? OR is there another way. I tried ones like the following but I'm guessing it only works with IP Addresses? ...
davidmcd's user avatar
  • 339
290 votes
11 answers
876k views

Remove key from known_hosts

I built several virtual machines during the last few weeks. The problem is, the .ssh/known_hosts gives me the Man in the middle warning. This happens because another fingerprint is associated with the ...
Adam Matan's user avatar
  • 8,360
27 votes
4 answers
44k views

Adding a line into the hosts file, getting permission denied when using sudo - Mac

I'm trying to add a line into the hosts file on my Mac by executing a one line command on the terminal. I thought this would be easy using sudo, but it returns "permission denied" when I try to add &...
Mint's user avatar
  • 148
25 votes
3 answers
10k views

Remove ads in Viber for PC [closed]

How do I disable ads in Viber for PC - version 11.4 (2019). The hosts file trick no longer works (the following one): 127.0.0.1 ads.viber.com 127.0.0.1 ads.aws.viber.com 127.0.0.1 ads-d.viber.com ...
Coder12345's user avatar
15 votes
2 answers
23k 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 ...
Sul Aga's user avatar
  • 253
13 votes
3 answers
22k views

How come hosts file redirection fails?

I am trying to redirect google.com to my local machine for fun and learning with this /etc/hosts file on my Mac. 127.0.0.1 www.google.com However, www.google.com still maps to the Google home page ...
David Faux's user avatar
  • 4,829
13 votes
1 answer
45k views

How to change IP address to point to localhost?

A sandbox enviroment of a web app is reachable directly by an IP address: http://<my_ip_address> without a login name. Is there a way to make a virtual host in my local machine, named as <...
Michele's user avatar
  • 253
12 votes
1 answer
16k views

How to list all DNS names pointing to an IP?

I know – for example – that there are two DNS names for an IP. However nslookup ip only returns one record. How do I get all the records for an IP?
user705414's user avatar
  • 1,395
11 votes
2 answers
32k views

Can a router map a URL to a local ip?

I'm setting up a facility with many different computers where I don't have access to their hosts files. How would I map test.com to a local server without using the hosts file? Can this be done using ...
Sauce McBoss's user avatar
  • 2,155
11 votes
3 answers
5k views

Mac OS X "hosts" file, can I include other files with it?

I am working on some automation scripts to configure my network settings, hosts file contents, and /etc/resolver files, when accessing different networks I frequent between. There are some ...
Lasse V. Karlsen's user avatar
10 votes
5 answers
23k views

DNS lookup fails but nslookup works

I have DNS lookup problems on my internal network. I'm using an internal DNS server with the IP 192.168.1.254. If I use nslookup everything works like it should: >hawk:~ user$ nslookup ...
Thomas Lundström's user avatar
7 votes
3 answers
28k views

Custom host file for Firefox

Instead of changing my host file I'd like Firefox to think my domain is on my own server while my other browser uses the real IP address. I used to edit my host files but that forces both browsers to ...
user avatar
6 votes
4 answers
8k views

Block website on Windows without host file

Is it possible to block website on Windows without modifying hosts files? The reason I do not want to use it is that users need administrator options to modify it. I need some easier way to block a ...
Giorgi's user avatar
  • 641
6 votes
5 answers
5k views

Firefox not taking note of /etc/hosts?

I've set foo.com to 127.0.0.1 in my /etc/hosts file in (located here on Windows: C:\Windows\System32\drivers\etc\hosts). Though Chrome loads foo.com with the one hosted locally on port 80, Firefox ...
A T's user avatar
  • 791
5 votes
2 answers
1k views

In your ssh config is it possible to have one host entry for multiple machines on the same domain

I'd like to be able to do something like Host * HostName *.mydomain.com ... So I can type something like ssh test ssh ci ssh dev Instead of having to type ssh test.mydomain.com ssh ci....
Joshua Olson's user avatar
5 votes
3 answers
6k views

hosts file and unblocked subdomains

I modified hosts file to block google.com and its subdomains but it blocks only the main domain name. It does not block the subdomains. Windows 7 Starter 127.0.0.1 google.com It blocks google.com ...
ilhan's user avatar
  • 554
5 votes
3 answers
18k views

How to alias a hostname?

Is it possible to keep a network alias - without specifying the IP address in the hosts file? For instance, I have abcd.efgh.com but want abcd -> abcd.efgh.com so that ping and ssh work as they ...
Jonas Byström's user avatar
5 votes
4 answers
2k views

Windows 7 HOSTS files keeps reverting it's permission back to READ-ONLY

As a full-time Web Developer I am constantly adding fake domains to my Windows 7 HOSTS file to point a domain to my localhost web server that I develop on. I have even built a nice little PHP script ...
JasonDavis's user avatar
  • 5,032
4 votes
2 answers
18k views

How to reroute all traffic using hosts file?

Is there a way to redirect all traffic to one IP in the hosts file? If not, how else could i achieve this?
hkdsf's user avatar
  • 41
3 votes
1 answer
2k views

Redirect one domain to other using hosts file or similar

Usually, the syntax in the /etc/hosts file is IP hostname alias1 alias2 but I want to make something like SERVER SERVER2 but I don't want to specify the SERVER IP in the file, only the host name....
Jonathan's user avatar
  • 247
3 votes
2 answers
25k views

changing hosts file on snow leopard

I need to add an entry to my hosts file on Snow Leopard. I could edit the hosts file with root user enabled, but in the system doesn't let me to save this file saying that I don't have permissions to ...
Nava Carmon's user avatar
3 votes
5 answers
18k views

Possible reasons WINDOWS\system32\drivers\etc\hosts is not working (appart from the obvious)

Here's my C:\WINDOWS\system32\drivers\etc\hosts file: 127.0.0.1 localhost 192.168.100.1 router testing it: C:\>ping router Ping request could not find host router. Please check the ...
rwired's user avatar
  • 1,223
3 votes
3 answers
11k views

ssh - no route to host

I have 3 machines (A, B and C) behind WLAN Router. From B i can make ssh to A and from A to B also. Ssh between C and A is also working (both destination, C->A and A->C). But when i try to connect B ...
cupakob's user avatar
  • 1,143
2 votes
1 answer
14k views

Can't block connections to google via HOSTS file

Steam and Spotify connects to "clients.l.google.com" (172.217.21.206) using 5 to 100 kb. It might be analytics. I blocked google.com, www.google.com, clients.l.google.com via hosts file, somehow it ...
namk's user avatar
  • 21
2 votes
1 answer
4k views

Redirect a url to another url

I need to redirect a url to another url. THe PC where this should be done has Linux but no server program such as Apache. When the user type www.mycomerp.com, it should redirect it to http://localhost:...
Noor's user avatar
  • 266
1 vote
3 answers
953 views

How to simulate entries in HOSTS file with an IE 7 browser plugin

Is it possible in Internet Explorer 7 to simulate HOSTS file entries with a plugin? For example, can you tell IE to resolve all requests for xyz.com to a specific IP address? We have some QA testers ...
frankadelic's user avatar
0 votes
1 answer
2k views

automatically add entries to hosts file

I have a hosts file on my dropbox in which I create shortcuts to all kinds of ip's that I use often (server dev is added as d, stackoverflow is added as so and so on). Over time I have built quite a ...
Henrov's user avatar
  • 168