Questions tagged [hosts]

A `hosts` file is used to map hostnames to IP addresses on a TCP/IP-enabled computer.

A hosts file is used to map hostnames to IP addresses on a TCP/IP-enabled computer. On Unix and Unix-like operating systems (Linux, OSX, FreeBSD, NetBSD, et al), the file is located at /etc/hosts. In Microsoft Windows, the file may be located in different places depending on the version of the operating system. In Plan 9 from Bell Labs it is located at /lib/ndb/hosts

On most systems, the behaviour of /etc/hosts depends on configuration within the /etc/nsswitch.conf file.

841 questions
13
votes
1 answer

Why does /etc/hosts not work anymore for some websites on Big Sur?

For years I’ve used /etc/hosts to adjust IP address. Sometimes it’s for prototyping, or adding an address for development purposes that isn’t ready to go into public DNS. And sometimes I block certain domains that I don’t want to visit by…
andrewdotn
  • 32,721
  • 10
  • 101
  • 130
13
votes
5 answers

Url mappings in hosts file in emulator is being ignored

I am using genymotion emulator and pulled hosts file from it using adb remount adb pull /system/etc/hosts C:\Users\Rkn09\Desktop\hosts and I added new mapping like 192.168.0.115 xxx.mydomain.com and I pushed it back to emulator using adb push…
Navakanth
  • 834
  • 1
  • 12
  • 24
13
votes
12 answers

Mamp localhost resolving very slowly

When I make local changes to my PHP / WordPress website, the localhost does not seem to update for 20-30 minutes. I'm on Mac OSX 10.8.4 and using MAMP Pro. I have two sites that I have created separate host entries for, let's call them mysite1.dev…
user2733720
  • 131
  • 1
  • 1
  • 3
12
votes
2 answers

How to get a virtual host to work in OS X Lion?

I'm trying to set up a virtual host on my Mac OS X 10.7 Installation. I'm using VirtualHostX to manage my /etc/hosts and httpd-vhosts.conf file. Currently, my httpd-vhosts.conf file looks like this: NameVirtualHost *:80
Yuval Karmi
  • 26,277
  • 39
  • 124
  • 175
12
votes
6 answers

Firefox not honoring hosts file

Firefox does not honor the hosts file when browsing to an URL. For example; My hosts file says 127.0.0.1 local.webdev.com and entering the local.webdev.com URL into the address bar sends me to the internet always, not localhost. Browsing to this URL…
Maarten
  • 402
  • 5
  • 20
12
votes
1 answer

How to configure user specific hosts file on Windows

There is Windows Server 2003 machine which has many users to access. Each of them want to configure their own hosts file to redirect a hostname to certain IP address. (They are virtual machines with same hostname and different IP addresses owned by…
imapollo
  • 387
  • 1
  • 2
  • 16
10
votes
1 answer

/etc/hosts ignored in mac El Capitan (10.11.5)

I'm attempting to redirect an existing web address to a remote machine on my subnet. To do that, I put the following into /etc/hosts 192.168.1.249 holub.com and flush the DNS cache with sudo dscacheutil -flushcache;sudo killall -HUP…
aholub
  • 393
  • 4
  • 10
10
votes
2 answers

Service in Windows 7 operating system not using the hosts file as local service

I have programmed a Windows Service that is calling another service over the network. The other service's IP is defined in the hosts file. The Windows Service is running as local system. On Windows Server 2008 this works fine. The IP from the hosts…
nvoigt
  • 75,013
  • 26
  • 93
  • 142
10
votes
5 answers

Windows 8 - IE cannot reach sites listed in hosts file

I have many local websites set up in IIS and have entries in my hosts file to make the websites available locally. I've come from a Windows 7 machine where everything was working correctly in all browsers. The move to Windows 8, using the same hosts…
10
votes
3 answers

Using System Hosts file for Android Emulators

I having problem in using my system hosts file details in Android Emulators. I have my website (www.example.com) deployed in Webserver. I am trying to access those website in Emulator from my desktop. My desktop has a hosts file with the entry…
user2642193
  • 101
  • 1
  • 1
  • 3
10
votes
1 answer

Android emulator hosts file

I wonder how I could update host file on a android virtual device? Each time I reopen emulator it appears with defaul hosts file, so I pull hosts file everytime. what I do now: emulator.exe -avd %avd_name% -partition-size 256 -gpu on adb.exe…
user854301
  • 5,383
  • 3
  • 28
  • 37
9
votes
3 answers

DNS redirects tracker.thepiratebay.org to 127.0.0.1

I tried pinging "tracker.thepiratebay.org" and for some reason the DNS returns 127.0.0.1 I get 0% packet loss, but, obviously, it isn't going to the correct website. My college uses a local DNS server, but I don't think that's where the problem is,…
shashwat
  • 992
  • 1
  • 13
  • 27
9
votes
4 answers

Windows hosts file

What's the difference between these lines: ::1 localhost ...and 127.0.0.1 localhost in Windows hosts file? Initially I had the line of the first kind in my hosts file and typing localhost in the browser led me to 127.0.0.1. Then…
Alex
  • 43,191
  • 44
  • 96
  • 127
9
votes
2 answers

Chrome ignoring hosts file for subdomains of localhost

When I attempt to visit http://mysubdomain.localhost chrome resolves to [::1]80, even if there is an explicit entry for this domain in the hosts file. No other browser behaves this way. Firefox, safari, and curl all resolve the IP address given in…
Matt Korostoff
  • 1,927
  • 2
  • 21
  • 26
9
votes
3 answers

System.Net.WebRequest not respecting hosts file

Is there a way to get a System.Net.WebRequest or System.Net.WebClient to respect the hosts or lmhosts file? For example: in my hosts file I have: 10.0.0.1 www.bing.com When I try to load Bing in a browser (both IE and FF) it fails to load as…
Nate
  • 1,669
  • 15
  • 22
1 2
3
55 56