Connecting to Public WiFi with Custom DNS Settings on MacOS

Where’s my free Wifi?

For months I have been having an issue with connecting my MacBook to public WiFi hotspots and nothing would coax it into life. It would be showing as connected but wouldn’t connect to any internet pages.

This was highly frustrating as it meant that I couldn’t do any work on public hotspots (I appreciate that there are a couple of positives of that scenario in that I couldn’t do any work and I was probably more secure).

In an effort to fix this I tried all of the following at one time or another:

  • Cleared the browser cache
  • Forgotten the network
  • Deregistered my device on the providers sites
  • Tried going to

Light at the end of the tunnel?

And then last week I found myself on a train with three hours to kill and so I decided that I needed to fix this once and for all.

I spent a happy half an hour revisiting the above list before I started to delve deeper into the network settings when I spotted this:

DNS Settings

In an effort to bolster security and improve speed I had switched over from the DNS servers handed out by whichever router I was connected to and move to using Cloudflare’s service. I wondered if that was it. So I removed them and lo and behold suddenly I had internet access!

While this was great it wasn’t very useful as I had to remember to add and remove the IP addresses when I switched between public and private networks. Turns out that Apple have thought of this and MacOS has the ability to create what it calls Locations and to easily switch between them making this much more convenient.

Setting up Locations in MacOS

Turns out that added a new location is easy. Firstly go to System Preferences and then choose Network. At the top you will see a drop down list labelled Location. Select this and then “Edit Locations…”.

Next add your required locations and click Done.

Location Manager

Now select the Location that you want to amend from the drop down and go through all the changes in each of the relevant tabs. In my case I only need to remove the IP addresses from the DNS tab from one location and leave them in for the other. Finally, click the Apply button at the bottom of the page to save the changes.

To switch locations you now just need to click on Apple symbol () in the top left of the menu bar, then Location and finally your desired location from the list.

Quickly Selecting your Location

All of this has certainly taken me some time to resolve but now I have it setup it is a real time saver. Hopefully it will save you some time too.