How to Fix Hosts File (Java Only)

The usage of alt account tools, such as MCLeaks, AltDispenser, Altening, etc. (which violate the EULA/ToS) have been causing issues for many Minecraft users.

When such programs are used, they make changes to a system file called ‘hosts’ that redirects Mojang authentication to their own servers.

As a result, users who have used alt account tools in the past will find that they either are not able to log in to the launcher or the website, or are not able to join servers. They will often get error messages such as:

  • "The authentication servers are down for maintenance."
  • "The authentication servers are currently not reachable."
  • "Please switch to Mojang mode."
  • "Not authenticated with minecraft.net."

Not only do these settings prevent users from logging in or joining servers, they also function to steal the user’s login information, resulting in account theft.

Part A: Remove the Tool

First, you will need to delete the tool. If you don’t know where it is, try looking in your Downloads folder or any Minecraft folder you have on your computer.

If You Used TheAltening

If you used TheAltening, you need to take extra steps to remove the tool completely:

Step 1

Press and type cmd.

Step 2

Right click Command Prompt and click Run as Adminstrator.

Step 3

In the black window, type taskkill /IM 'altening.launcher.exe' /F and press enter. If it tells you that it could not find it, move on to the next step.

Step 4

Press and R at the same time. Then type %appdata% and press enter.

Step 5

Find a folder called ‘Altening’ and delete it.

Part B: Reset Your Hosts File

You then will need to edit your hosts file to undo the changes made by the alt account tools to be able to log in to Minecraft again. Follow the instructions according to your operating system.

Step 1

Press and R at the same time.

Step 2

In the Run box, copy and paste the entire command:powershell -command "Start-Process notepad $env:windir\system32\drivers\etc\hosts" -Verb runas

Step 3

A blue window will briefly appear, then a UAC window. Click Yes in the UAC window that pops up. A Notepad window should open with text.

Step 4

Look for 2 lines that contain the word ‘mojang’ and delete those two lines completely.

Step 5

Save the notepad file. Make sure Notepad does not ask you where to save the file; if that happens, start over and make sure you type the whole command in #2 above.

Step 6

Try Minecraft again. If it works now, close Notepad.

Step 7

Be sure to change your Minecraft password to something strong. Also change your email’s password if it is the same as your old Minecraft password. Use a password strength meter (google ‘password strength meter’) to check your password strength.

Alternate Method (Including Windows 7 users)

If the above steps don’t work, usually because of the UAC window not popping up in Step #3 above or Windows 7 not having Powershell, the hosts file can be restored manually.

Step 1

Press and R at the same time.

Step 2

In the Run box, type %systemroot%\system32\drivers\etc and press Enter.

Step 3

In the File Explorer window, if nothing shows up, click on View on the top, then check the box for Show Hidden Files.

Step 4

Hold down Ctrl while dragging the hosts file to your desktop.

Step 5

Double-click the hosts file on the desktop and open with Notepad.

Step 6

Look for 2 lines containing ‘mojang’ and delete those two lines completely. Save and close Notepad.

Step 7

Look at the icon for the hosts file on your desktop. It should look like a blank sheet of paper. If it looks like a sheet of paper with lines on it, start over and be sure to follow the instructions exactly as written.

Step 8

Drag the hosts file back into the ‘etc’ folder. Click Replace the file… then Continue in the windows that pop up.

Step 9

Try Minecraft. If Minecraft now works, delete the hosts file from your desktop. Change your Minecraft password right away. Also change your email’s password if it is the same as your Minecraft password. Use a password strength meter (google ‘password strength meter’) to check your password strength.

Step 1

Open the Terminal:

  • In the Finder, go to Applications > Utilities > Terminal.
  • Or, in the Finder, press Cmd-Space to bring up Spotlight search, then type terminal and press Enter.

Step 2

In the Terminal, type sudo nano /private/etc/hosts and press Enter.

Step 3

You will be prompted for your password. Type in your Mac password carefully. Nothing will show up as you type your password. Press Enter when you are done.

Step 4

The hosts file will appear in the terminal. Use the arrow keys to navigate the file.

Step 5

Go down to the bottom of the file. There should be 2 lines containing ‘mojang’.

Step 6

Using the arrow keys and the Backspace key, delete those two lines entirely.

Step 7

Press Ctrl-O (not Cmd-O) then Enter to save the file. Leave the terminal window open and try Minecraft again. If Minecraft is still open, close and reopen it.

Step 8

If Minecraft works, close the Terminal window and change your Minecraft password right away. Also change your email’s password if it is the same as your Minecraft password. Use a password strength meter (google ‘password strength meter’) to check your password strength.

Step 1

Open the Terminal:

  • Ubuntu: Press Ctrl + Alt + T
  • Other Debian: Open the start menu and type ‘terminal’ in the search bar, then click on Terminal

Step 2

In the terminal, type sudo nano /etc/hosts and press Enter.

Step 3

You will be prompted for your password. Type in your Linux user password carefully. Nothing will show up as you type your password. Press Enter when you are done.

Step 4

The hosts file will appear in the terminal. Use the arrow keys to navigate the file.

Step 5

Go down to the bottom of the file. There should be 2 lines containing ‘mojang.’

Step 6

Using the arrow keys and the Backspace key, delete those two lines entirely.

Step 7

Press Ctrl-O then Enter to save the file. Leave the window open then try Minecraft again. If Minecraft is still open, close and reopen it.

Step 8

If Minecraft works, close the Terminal window and change your Minecraft password right away. Also change your email’s password if it is the same as your Minecraft password. Use a password strength meter (google ‘password strength meter’) to check your password strength.