2

I am confused why my host name in /etc/hosts works for Google Chrome only. Not on Safari, not on Firefox, not from command-line tools like curl.

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost    

127.0.0.1       cool.pl.localhost

Only on chrome http://cool.pl.localhost:8080 works. On other browsers I can reach the site only by entering 0.0.0.0:8080 or 127.0.0.1:8080.

Confused what is misconfigured. What magic is Google Chrome doing that it works?

  • Have you tried /private/etc/hosts ? – Jacob Vanus Oct 23 '17 at 16:17
  • @Jacob That's the same file, /etc is a symlink to /private/etc. – grg Oct 23 '17 at 16:29
  • @grgarside Usually, yes. Not in all cases tho, and its easy to check. This bit me twice a few versions ago (10.10 maybe, I can't remember for sure). But it was painful enough to find that now I always double check. ;-) – Jacob Vanus Oct 23 '17 at 16:59
1

I think I just found the answer to this problem. If you are working on a virtual machine, as I am, and you change the /etc/hosts file in your virtual linux machine, only chrome will detect that. You will need to change the hosts file in windows (c:\windows\system32\drivers\etc\hosts) in order to force firefox to check the table. The moment I change that file, firefox recognized the new mapped names.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .