How do I change my hosts file from read only?

Locate the hosts file, right-click it and choose Properties from the menu. Go to the Attributes section and make sure the Read-only option isn’t checked. Click Apply and OK to save changes.

Why can’t I edit hosts file Mac?

Make sure that there is a space between the IP address and the domain name, otherwise it won’t work. Note: If the file is locked to prevent you from editing it, which is likely if you’re running on OS X 10.11 or later, you must disable SIP protection before you can make any changes.

How do I change permissions on hosts file Mac?

  1. Open TextEdit as sudo sudo -b /Applications/TextEdit.app/Contents/MacOS/TextEdit.
  2. Open /etc/hosts in this new TextEdit instance using any of the following methods: Append the path to the end of the previous command. Use File → Open. Drag the file to the sudo’d TextEdit on the Dock.

How do I unlock my hosts file Mac?

Hosts File Location

  1. Launch the macOS Terminal application.
  2. Go to the Finder, then Click Go.
  3. Click Utilities.
  4. Double-click Terminal to launch the Terminal window.
  5. Now, enter the following command: sudo nano /etc/hosts.
  6. Then, enter the sudo password for your user to allow edit access to the file.

How do you fix the existing file is marked as read only?

How to Change the Read-Only Attribute on Files and Folders

  1. Right-click the file or folder icon.
  2. Remove the check mark by the Read Only item in the file’s Properties dialog box. The attributes are found at the bottom of the General tab.
  3. Click OK.

How do I edit etc hosts?

Use the following instructions if you’re running Linux:

  1. Open a Terminal window.
  2. Enter the following command to open the hosts file in a text editor: sudo nano /etc/hosts.
  3. Enter your domain user password.
  4. Make the necessary changes to the file.
  5. Press Control-X.
  6. When you are asked if you want to save your changes, enter y.

Why is my file read only?

The content is in protected view This is also commonly the case with email attachments or files you’ve downloaded. To help protect your computer, files from these potentially unsafe locations are opened in Protected View. By using Protected View, you can read a file and see its contents while reducing the risks.

How to edit the hosts file on a Mac?

Follow these steps to edit your Mac’s hosts file: Open the Terminal application which can be found by opening a Finder window and navigating to Applications and then Utilities. In the Terminal window enter the following command: sudo nano /etc/hosts

What is hosthosts on Mac?

Hosts file is a hidden gem on your Mac that lets you override DNS settings exactly as specified.

How do I edit the hosts file in Ubuntu terminal?

You may either type Terminalin the Spotlight search or by navigating to Applications , then the Utilitiesfolder, then click on the Terminalapp. Open the hostsfile for editing. In the terminal window you just opened copy/paste the command string below, and press return. sudo nano /private/etc/hostsor sudo nano /etc/hostson newer MacOS.

What is the hosts file and how to use it?

The hosts fileis used by your computer to lookup/resolve domain names to an IP address. This file can be used to force your computer to resolve your website to a specific IP address rather than resolving your website using the DNS found in the name servers the domain is pointed to.