/etc/hosts filling up with millions of duplicate entries

Report any found bug here. We are grateful for any useful clues.

Moderator: severin

Post Reply
Posts: 1
Joined: Wed 24. Apr 2013, 20:33

/etc/hosts filling up with millions of duplicate entries

Post by IWorkInPixels » Wed 24. Apr 2013, 20:42

My MAMP PRO 2.14 has recently started refusing to start (occasionally runs, but mostly hangs with the mysql spinner still going) and it doesn't spawn any mysqld processes. I tried many, many things suggested on various forums, and then I noticed something weird... here's what /etc/hosts looks like now...

Code: Select all

# Host Database
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##       localhost broadcasthost
::1             localhost
fe80::1%lo0     localhost       mydomain.local       mydomain.local       mydomain.local       mydomain.local
[...]       mydomain.local       mydomain.local
The last row number is 4194316 (!!!!)

Deleting all the offending entries and restarting MAMP doesn't help. What should I check next?

EDIT: Mountain Lion.

Posts: 1
Joined: Thu 11. Jul 2013, 02:21

Re: /etc/hosts filling up with millions of duplicate entries

Post by ipixel » Thu 11. Jul 2013, 02:28

Just to report that I also encountered this problem. It occurred after adding a new host to MAMP Pro (v2.1.4 running on Mac OS X 10.7.5). At first I thought the problem was with mySQL failing to start, but the symptoms and fixes didn't quite match. It wasn't until I checked the size of my hosts file that something looked a little off - ie. it had grown to over 50MB in size. Upon checking it there were over 2 million lines, with a repeated entry being the main problem.

Basically when attempting to start MAMP Pro, it would show the diamond appearing next to mySQL, and then it would hang, pegging the CPU at 100% and showing it becoming unresponsive in the Activity Monitor. Looking at the logs didn't show up anything wrong.

Removing the offending entries from /etc/hosts using a text editor and trying to start MAMP Pro again worked fine and now all is back to normal.


Keyword: mamp pro won't start

Posts: 1
Joined: Tue 1. Oct 2013, 16:11

Re: /etc/hosts filling up with millions of duplicate entries

Post by edwinwright » Tue 1. Oct 2013, 16:30

I'm having this problem too. I am running Mac OS X 10.8.5 and have just installed MAMP PRO 2.1.4

Every time the MAMP server is stopped it edits the hosts file like so:

1. Removes all the MAMP configured hosts lines and
2. Adds two new lines to the end of the file (e.g. mywebsite.localhost)

When the MAMP server is restarted it puts the virtual hosts back in, but does not remove the duplicate entries.
I can manually remove these to clean it up, but they keep coming back.

Is there a permanent fix for this?


Posts: 12
Joined: Sun 29. Jul 2007, 09:17

Re: /etc/hosts filling up with millions of duplicate entries

Post by danielkoch » Sat 26. Oct 2013, 08:41

I have the same probleme but cannot resolve this permanently. Everytime I shutdown MAMP Pro (specially MySQL service) I get the error (MAMP is filling /etc/hosts with duplicated "hostname" entries and after the file is grown up to 60 MB MAMP is not responding anymore).

Do you have any ideas how I can solve this problem?

OS X: 10.9
MAMP Pro 2.2

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest