Skip to content

A simple Python script that rearranges your /etc/hosts to resolve Google Chrome "resolving host" issues

Notifications You must be signed in to change notification settings

productgang/speedhosts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Speedhosts

When you're using MAMP Pro you'll notice that Google Chrome will sometimes take while "resolving host". This is due to MAMP Pro creating a single line for each entry, and you'll end up with something like this in your /etc/hosts:

127.0.0.1       localhost       # MAMP PRO - Do NOT remove this entry!
127.0.0.1       api.tracklist   # MAMP PRO - Do NOT remove this entry!
127.0.0.1       br.local        # MAMP PRO - Do NOT remove this entry!

The solution is to put them all into a single line like so:

127.0.0.1 localhost api.tracklist br.local

Since MAMP Pro recreates all the lines on every modification of your virtual hosts, I have created this Python script that rearranges your /etc/hosts entries.

Usage

sudo python speedhosts.py

(Just in case, speedhosts creates a backup of your hosts file in /etc/hosts.bak)

About

A simple Python script that rearranges your /etc/hosts to resolve Google Chrome "resolving host" issues

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages