


How to set up hosts on Mac computer (steps with pictures and text)
What is the hosts file?
The hosts file is a system file. By binding the relationship between the domain name and the IP, when the machine accesses the domain name, it will find the corresponding file from this file. If the record is found, the corresponding web page will be opened immediately. If not found, DNS public network resolution will be used to open the web page. Therefore, it is a good way to speed up access and local development and bind domain names.
Mac computer sets hosts local virtual domain name access steps:
Step 1: Find the terminal in the mac computer and open it (click on the upper left corner of the desktop [Magnifying glass
] to "Search", enter "Term
" or "term
" and the "Terminal" will be displayed, and then open it.) As shown below :
Step 2: Input sudo vim /ect/hosts
in the opened window and press "Enter key" Enter
Step 3:Enter the password set by your MAC computer and press Enter
The following content will be displayed
Step 4: In the input method English mode, enter i
to enter the editing mode. This An INSERT will be displayed in the lower left corner. Press the down and right keys on the keyboard to move the cursor to the end of the last line, and then press Enter to start a new line. Enter 127.0.0.1 www.test.com as shown below
This domain name can be replaced with your own domain name
Step 5:Then Press the ESC key
, then enter :wq
and press Enter. It will be automatically saved and you can end the editor.
In this way, the hosts domain name has been added successfully. You can check whether it takes effect by ping www.test.com
.
At this point, the Mac computer has set up the hosts file and set up access to the local virtual domain name. This will make it much more convenient for us to develop and demonstrate the local website program. Hurry up and try it!
Note: phpstudy V8 PHP development integrated environment can be added to the local hosts file by default when adding a domain name, but currently only supports the Windows version. We look forward to the early development of the MAC version of phpstudy Finish!
The above is the detailed content of How to set up hosts on Mac computer (steps with pictures and text). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Solution to changing hosts in Linux does not take effect: 1. Find and open the "/etc/sysconfig/network" file; 2. Modify HOSTNAME to the corresponding alias, such as "NETWORKING=yes HOSTNAME=host1"; 3. Through "service network restart" command to restart the network service.

How to solve the problem that the hosts file in Win10 system is missing? The hosts file is a very important file in a Win10 computer. Recently, some friends found that their hosts file was missing when they wanted to modify the hosts file. So what should they do if they encounter this situation? Let’s take a look at how to recover the missing hosts file in Win10 system with the editor. How to recover the missing hosts file in Win10 system 1. Open C:WindowsSystem32driversetc; 2. Open the view option; 3. Remove the check mark in front of Hide protected operating system files and confirm; 4. Refresh and you will see the Hosts file.

As a user of Windows 10, have you encountered the dilemma of being unable to save changes when trying to modify the hosts file? This file can be regarded as a "database" that closely links the URL domain name and its corresponding IP address. So how to cleverly How to deal with this situation? What should I do if the hosts of Win10 Home Edition cannot be modified? 1. Press the Ctrl+C shortcut key to copy the following path: C:\Windows\System32\drivers\etc. 2. Paste this path into the address bar in the file manager and right-click the upper right corner of the folder where the hosts file is located. 3. Select the "File" menu, select the WindowsPowerShell option, and then a dialog box will pop up. 4

Deleting the hosts file has no effect; hosts is a system file without an extension, which can be opened with tools such as Notepad. Its function is to establish an associated "database" between some commonly used website domain names and their corresponding IP addresses; when the user is in When you enter a URL that requires login into the browser, the system will first automatically search for the corresponding IP address in the Hosts file. Once found, the system will immediately open the corresponding web page. If not found, the system will submit the URL to the DNS domain name resolution server. Perform IP address resolution.

Microsoft has released a new feature update for PowerToys. Version 0.64.0 is available for download now and includes two brand new utilities, settings backup and an extensive list of fixes. PowerToys 0.64.0 introduces a new FileLocksmith utility (shown below). It allows you to see which process or processes use selected files or folders, thereby preventing them from being deleted or modified. The second new tool provides a simple and convenient UI for editing Hosts files—no more digging into your system drive and opening Hosts in Notepad. You can view detailed information about processes and even end them if necessary. 0.64.0

The location of the hosts file in Linux hosts is a system file without an extension. Its function is to establish an associated "database" between some commonly used URL domain names and their corresponding IP addresses. When the user enters a URL that needs to be logged in in the browser, The system will first automatically search for the corresponding IP address in the Hosts file. Once found, the system will immediately open the corresponding web page. For all Linux operating system distributions, the hosts file is located at: /etc/hosts Extension content The hosts file (domain name resolution file [1]) is a computer file used to store information about each node in the computer network. This file is responsible for mapping host names to corresponding IP addresses. hosts file

The location of the hosts file is in the "etc" folder. The specific search method is: 1. Enter "Computer" from the desktop and double-click to open "C drive"; 2. Double-click to open "windows" -> "System32" -> "drivers" "-> "etc"; 3. Double-click to open the "etc" folder to find the "hosts" file.

The path of the hosts file is "C:\Windows\System32\drivers\etc". Hosts is a system file without an extension. Its function is to establish an associated "database" between some commonly used URL domain names and their corresponding IP addresses. When the user enters a URL that needs to be logged in in the browser, the system will first automatically start from Find the corresponding IP address in the Hosts file and open the corresponding web page; if not found, the system will submit the URL to the DNS domain name resolution server for IP address resolution.
