MAMP Pro Wildcard DNS / Virtual HostI use MAMP Pro for my Mac OS localhost WordPress development environment. Lately, I’ve been working with a few WordPress multisite subdomain installs, and I’ve been frustrated without the inability to setup a local Wildcard DNS using the Hosts > General > Aliases option. Luckily, I found a work-around to enable Wildcard DNS on my localhost for each Host I have set. Here’s how I did it:

Follow These Steps

  1. Open up MAMP Pro
  2. Go to: File -> Edit Template -> Apache -> httpd.conf
  3. Search for this line: ServerName MAMP_VirtualHost_ServerName_MAMP
  4. Add this directly below it: ServerAlias *.MAMP_VirtualHost_ServerName_MAMP
  5. Restart MAMP.

That’s it, you now have a localhost wildcard DNS setup for your MAMP Pro development environment.

Be aware

This will automatically add a wildcard ServerAlias to all your MAMP Pro hosts, which you may or may not want depending on your situation.

Meet the Author

Kevin Leary, Boston WordPress Developer of 10 Years

I'm a freelance web developer and WordPress consultant in Boston, MA with 13 years of experience building websites and applications. View a portfolio of my work or request an estimate for your next project.