Mac OS X ignores hosts file

The Mac seems to ignore new changes to my hosts file. Older changes work without problems. I spent the last 4 hours trying to figure it out. Help!

I have folders for every site that I create in the / Sites folder. For example, several folders are called:

wp.dev daf.dev test.dev 

I run MAMP, set the Apache port to 80 and the MySQL port to 3306 (so I do not need to add the port to the address bar in the browser).

I edited my / private / etc / hosts file as follows:

 ## # 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 wp.dev 127.0.0.1 daf.dev 127.0.0.1 test.dev fe80::1%lo0 localhost 

Here the kicker: wp.dev and daf.dev have been around for more than a month. They resolve without problems in my browser. This morning I added test.dev. When I enter it into the browser, it just searches for "test.dev" as opposed to the domain resolution.

I can execute any of the above domains and go to 127.0.0.1, including test.dev.

For what it's worth, I tried virtualhostsx with the same problem. I also run dscacheutil --flushcache and restart MAMP when making changes.

I need to start development on a new site, and it drives me crazy.

+6
source share
1 answer

Try putting all your entries at the top of the file.

Not entirely logical, but worth a try .

+19
source

Source: https://habr.com/ru/post/906042/


All Articles