MAMP Pro and Slow Name Resolving

I found this post by Bramus Van Damme on his blog Bram.us whilst tearing my hair out about slow DNS resolving when using the .local TLD extension to route to a Mac to itself on a MAMP-style setup. I was just about to throw something out of the nearest window when I read this:

Though the .local domain is not defined as a valid top-level domain on the Internet, some private networks have DNS servers that assign hostnames in the .local domain. By default Mac OS X does not use the DNS server to resolve these names. This may result in unexpected failures to connect to .local hostnames defined by your server.

The work-around, as detailed by Bramus, requires editing the hosts file for each instance of a local domain. Because despite using MAMP Pro to get around this in the first instance, they didn’t see this one coming. The alternative is not using the .local TLD, which I’ve done since the year dot and would rather not change. There are other alternatives, like running a script from the terminal every time the DNS changes or adding a subdomain to every local domain, but I’d rather kill myself.

Just another little thing that makes the Mac experience that much nicer.