Modifying entries in the hosts file is a commonly used step in troubleshooting connectivity issues.

Notes:

  • you need to have Administrator permissions in order to modify the hosts file
  • you may need to reboot your machine or flush DNS cache for the changes to take effect

Windows

Windows 7/8/10

  1. Select the hosts file located in c:\WINDOWS\system32\drivers\etc
  2. Open the file in Notepad
    Note:
    Notepad must be opened with administrative permissions
  3. Scroll to the end of the file to find your Exchange server or Autodiscover information. Read Knowledge Base article on What Is An Autodiscover Record And Why Do I Need It?
    It should look something like this:
    • 207.5.74.69      autodiscover.testdomain.com
  4. If the file already contains Exchange-related lines, add a new line before the existing ones. If you do not find any existing Exchange server or Autodiscover lines, add a line at the bottom of the file. Your new entry should look something like this:
    • 207.5.74.69      autodiscover.testdomain.com
  5. Save the file

Add a new line

Windows Vista

  1. Go to Start > Search > All Files or Folders (include hidden and system files)
  2. Search for files named hosts
  3. Select the 'hosts' file located in c:\WINDOWS\system32\drivers\etc
  4. Open the file in Notepad
    Note:
     Notepad must be opened with administrative permissions
  5. Scroll to the end of the file to find your Exchange server or Autodiscover information.
    Read Knowledge Base article on What Is An Autodiscover Record And Why Do I Need It?
    It should look similar to this:
    • 207.5.74.69      autodiscover.testdomain.com
  6. If the file already contains Exchange-related lines, add a new line before the existing ones. If you do not find any existing Exchange server or Autodiscover lines, add a line at the bottom of the file. Your new entry should look similar to this:
    • 207.5.74.69      autodiscover.testdomain.com
  7. Save the file

Mac OS

Using TextEdit

  1. Right-click the Finder icon in the bottom menu and click Go to Folder. Type /private/etc/hosts and click Go  and open the file in TextEdit
    Go to folder
  2. Put the cursor on some empty line in the text and hit Enter.
  3. You won't be allowed to make changes to the original file and will be asked to save the duplicate file elsewhere. Select Duplicate.
  4. Uncheck the option If no extension is provided, user ".txt" at the bottom of the window. Save the file to the Desktop or any other location.
    Saving hosts file
  5. Scroll to the end of the file to find your Exchange server or Autodiscover information.
    Read Knowledge Base article on What Is An Autodiscover Record And Why Do I Need It?
    It should look similar to this:
    • 207.5.74.69      autodiscover.testdomain.com
  6. If the file already contains Exchange-related lines, add a new line before the existing ones. If you do not find any existing Exchange server or Autodiscover lines, add a line at the bottom of the file. Your new entry should look similar to this:
    • 207.5.74.69      autodiscover.testdomain.com
      Add a new line
  7. Save the file and drag and drop the file back to its original location at /private/etc.
  8. Choose Authenticate, then Replace when asked what to do with the unmodified file, and enter your administrator password.

Using Nano

Using the built-in Nano editor allows avoiding the hosts file duplication when using Text Edit.

  1. Open Terminal and type sudo nano /private/etc/hosts. Enter your administrator password to open the file
  2. Scroll to the end of the file to find your Exchange server or Autodiscover information. Read Knowledge Base article on What Is An Autodiscover Record And Why Do I Need It?
    It should look similar to this:
    • 207.5.74.69      autodiscover.testdomain.com
  3. If the file already contains Exchange-related lines, add a new line before the existing ones. If you do not find any existing Exchange server or Autodiscover lines, add a line at the bottom of the file. Your new entry should look similar to this:
    • 207.5.74.69      autodiscover.testdomain.com
  4. To save changes:
    1. press Control-X to exit the editor
    2. press Y to save the file
    3. press Return to overwrite the existing hosts file
      Add a new line