Every Mac has a “hosts” file.

The hosts file also tracks things like licenses when you do updates.

We’ll also show you how to repair the hosts file to fix it.

Man gesturing in frustration while using a laptop at a desk

Yet, when you launch your web net internet ride, your setup connects to the internet just fine.

To access your hosts file, openFinder.

From the menu bar, clickGo > Go to folderand throw in in/private/etc/hosts.

A healthy hosts file without corrupt code

Double-click thehostsfile to open it.

It will open in a simple text editor.

A clean hosts file should look like the one in the picture below.

A corrupt hosts file

If you see additional lines, that’s what’s keeping your machine from connecting.

For whatever reason, this app likely failed mid-update and left the partial text behind in the hosts file.

This text will have to be removed by hand before the Mac will be able to update correctly.

you’ve got the option to duplicate this document and edit the duplicate.

Only the duplicate will include your changes.

Now save thehosts copyfile to your desktop and terminate the original hosts file.

Next, Control-click toRenamethe originalhostsfile; set it tohosts original.

You will be prompted to input your password.

After that’s done, go to your desktop and renamehosts copytohosts.

Lastly, drag the editedhostsfile back into theetcfolder in Finder.

You will now have an updated hosts file, minus the corrupt text.

You should first confirm that your Mac is able to get onto the internet after restarting.

If there are no issues, then try repeating whatever activity triggered the original problem.

If your hosts file was indeed the issue, your system should now be behaving correctly.

You may also want to look atthe best Mac tools to repair corrupted filesin case this issue appears elsewhere.

If you are still having the same problem, you will have to troubleshoot beyond the hosts file.