How do you update the hosts file on a Mac?

How do I update my etc hosts file Mac?

Click Utilities.

  1. Double-click Terminal to launch the Terminal window.
  2. Now, enter the following command: sudo nano /etc/hosts. Then, enter the sudo password for your user to allow edit access to the file. …
  3. Next, press Control+O to overwrite the existing file, then press Enter to confirm the overwriting.

How do I fix host file on Mac?

How to reset your Mac’s Hosts file

  1. Make sure Finder is selected on your Mac.
  2. Click on Go in the Mac menu bar.
  3. Click on Go to Folder.
  4. Enter /private/etc/hosts into the search field.
  5. Click Go.
  6. Drag the Hosts file from the Finder window onto your desktop.
  7. Open the Hosts file from your desktop.

How do you update your hosts file?

Windows

  1. Press the Windows key.
  2. Type Notepad in the search field.
  3. In the search results, right-click Notepad and select Run as administrator.
  4. From Notepad, open the following file: c:WindowsSystem32Driversetchosts.
  5. Make the necessary changes to the file.
  6. Select File > Save to save your changes.

How do I find my host file on Mac?

To locate the Hosts file on Mac: Select Go ➙ Go to Folder… from the Mac menu bar. Type in /private/etc/hosts. Click Go.

THIS IS INTERESTING:  What is the relationship between web clients and web servers?

How do I find my hostname on Mac?

Find your computer’s local hostname

On your Mac, choose Apple menu > System Preferences, then click Sharing. Your computer’s local hostname is displayed beneath the computer’s name at the top of Sharing preferences.

How do I edit host file on Macbook Pro?

How to Edit Mac Hosts File

  1. Step 1: Open the Mac Terminal. Open the Finder, and go to Applications > Utilities > Terminal. Type the following in the terminal window: sudo nano /private/etc/hosts. …
  2. Step 2: Edit Mac Hosts File. The IP address is first, and the server name comes second. Comments are indicated with a ‘#’ sign.

How do I edit documents on a Mac?

Click the insertion cursor anywhere in the file and begin typing. Or, to edit existing text, drag the insertion cursor across the characters to highlight them and type the replacement text. TextEdit automatically replaces the existing characters with those that you type.

How do I restore the host file on a Mac?

How to Reset the Hosts File Back to Default in macOS

  1. From the Finder, navigate to Go → Go to Folder.
  2. Type this in the Go to Folder window: /private/etc/hosts.
  3. From the finder window, click and drag the hosts file to the desktop.

How do I open host file as administrator?

Workaround

  1. Click Start, click All Programs, click Accessories, right-click Notepad, and then click Run as administrator. …
  2. Open the Hosts file or the Lmhosts file, make the necessary changes, and then click Save on the File menu.