Book Your Repair

How To Quickly Edit Mac’s Hosts File? Step By Step Guide With Pictures

In this article, learn how to quickly edit mac’s hosts file. If you regularly use a Mac, you are aware of how easy and natural the process may be. Dragging and dropping icons and files while having the environment perfectly organized is almost like playing.

Despite their apparent simplicity, Macs are incredibly powerful devices that have the potential to unlock their programmable side and enable keyboard control. All of this is possible because macOS is built on the Unix system, just like Linux and many other operating systems that are renowned for offering considerably more control than more closed systems like Windows.

When testing your network, editing your host’s file can be helpful. You can avoid the process in which a web browser utilizes a Domain Name Server (DNS) search to translate the domain name to the IP address by mapping an IP address to a server name (or domain name).

How To Quickly Edit Mac’s Hosts File?

In this post, we will learn “How To Quickly Edit Mac’s Hosts File? But before that, you need to know some basics about Mac Host File.

What and where is the Mac Hosts file?

Your Mac has a hidden gem called the host’s file that enables you to modify DNS settings precisely as requested. Let’s expand. Any website on the internet has a common numerical TCP/IP address, such as 155.135.55.81, which is how your browser can actually find the website you’re looking for. All those TCP/IP numbers, however, would be impossible for anyone to remember, which is why the Domain Management System (DNS) was developed.

When you enter a URL in your browser, such as setapp.com, it first pings the domain server, which converts the requested domain into the TCP/IP format, and only then establishes a connection in order to display the desired domain.

There are times when you would much rather write down your own name than have the domain name go to the actual TCP/IP. This may be required if you want to test a brand-new website that you’re building locally or an entirely new development server. Additionally, you can use the Hosts file on a Mac to block time-wasting and adware-infected websites (e.g. social media).

Factors To Change Your Hosts File

There are situations when it would be preferable to write down your own instead of having the domain name go to the actual TCP/IP. This may be required if you want to test a brand-new website that you’re building locally or an entirely new development server.

Additionally, you can use the Hosts file on a Mac to block time-wasting and adware-infected websites (e.g. social media).

How to quickly edit mac’s host file in macOS? And How To Quickly Edit Mac’s Hosts File?

Although it is absolutely non-obvious, editing the host file on a Mac is not a tough operation. You must use Terminal to access the secret Hosts file on Mac:

Step 1: Launch Mac Terminal

  • Open the Finder
  • Then go to Applications > Utilities > Terminal
  • In the terminal window, enter the following:
how to quickly edit mac's hosts file

You should be prompted by the system to enter your password, which you also use to log in. Enter it once you’ve typed it.

Step 2: Edit Mac hosts file

The server name is listed after the IP address. A “#” sign is used to denote comments. Consider the following example:

Before entering the server name (or domain name) you want to link to it, enter the IP address you want to refer to first. Then, press space.

  • By entering a # at the start of a line, you can instruct Mac OS to overlook a mistaken line.
  • Press Command + O to save your changes, and Command + X to go.

How To Quickly Edit Mac’s Hosts Files In Windows?

Step 1: Launch Notepad As An Administrator

To do this action, you must have administrator rights.

  1. Open Notepad
  2. Right-click on it and select Run as Administrator
  3. The pop-up window Do you want to allow this app to make changes to your device? appears, and select Yes.

Step 2: Open The Windows

  1. Go to File > New in Notepad
  2. Browse to c:windowssystem32driversetc
  3. Click the drop-down menu to select All Files from the file type drop-down menu in the lower-right corner, immediately above the Open button.
  4. Click Hosts and select Open or double-click on the Hosts

Step 3: Edit The File

You can get a brief description of how to write a new line in the Windows hosts file. Here is a quick summary:

The first four digits represent the IP address that you’re mapping. This could either be the internal IP address of a network server or the IP address of a website. The second label is the name you want to be able to type in a browser to reach the server at the IP address you just entered.

When you’re done editing, save the file using this below command:

  1. Go to File > Save
  2. Click on Exit

If you want to edit to the hosts file and something malfunction occurs, By adding a # symbol at the beginning of any line, you can instruct Windows to ignore that line. It looks like this:

If you are still confused with the steps, you can contact Apple service center. We, Techyuga provide all types of software solutions for Apple devices. Contact us for more details.

Conclusion On “How to quickly edit mac’s hosts file in macos”

How to quickly edit Mac’s host file? Now you solved your queries on editing to the hosts file. It is a simple task and especially convenient that the file looks the same, regardless of your running. To get started, simply indicate the name you wish to type into a browser after knowing the IP address of the server you want to connect to. If you’re a Mac user and found this article useful, you might want to check our Website and Contact TECHYUGA

Hope you like this article on “how to quickly edit mac’s hosts file in mac terminal”. If you have any questions, you can leave them in the comment section below. I will be happy to respond.

Ranjitha Viju

Ranjitha Viju

I'm Ranjitha. I love working with WordPress and doing it the right way. Keep it as simple as possible for users to publish their comments. I can be found writing and developing all sorts of great content. I want to learn new technologies day by day.

We will be happy to hear your thoughts

Leave a reply

Techyuga
Logo