Safari can’t find the server `localhost`

The Problem

I’m running the latest version of MAMP (3.4) on my Mac running the latest version of OS X (10.11.3). When I nav to localhost:8888/, Safari gives me the following message:

Safari can’t find the server.

Safari can’t open the page “localhost:8888” because Safari can’t find the server “localhost”.

It works just fine in Chrome and Firefox. And I swear this worked a few months ago in Safari.

I can get Safari to connect to MAMP using 127.0.0.1:8888 or lapalapa.local:8888 (lapalapa is my Computer Name as set in System Preferences > Sharing). But that workaround isn’t ideal. I would really like localhost:8888 to just work as it should so that my local install of a WordPress site I’m working on loads in Safari.

The Solution

Are you f’ing kidding me? Restarting my Mac fixed it. I wonder if just killing Safari would have fixed it.

sigh