search
HomeBackend DevelopmentPHP TutorialHow 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 :

How to set up hosts on Mac computer (steps with pictures and text)

Step 2: Input sudo vim /ect/hosts in the opened window and press "Enter key" Enter

How to set up hosts on Mac computer (steps with pictures and text)

Step 3:Enter the password set by your MAC computer and press Enter

How to set up hosts on Mac computer (steps with pictures and text)

The following content will be displayed

How to set up hosts on Mac computer (steps with pictures and text)

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

How to set up hosts on Mac computer (steps with pictures and text)

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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
linux改hosts不生效怎么办linux改hosts不生效怎么办Mar 27, 2023 am 10:08 AM

linux改hosts不生效的解决办法:1、找到并打开“/etc/sysconfig/network”文件;2、将HOSTNAME修改成对应的别名,如“NETWORKING=yes HOSTNAME=host1”;3、通过“service network restart”命令重启网络服务即可。

Win10系统hosts文件不见了如何解决Win10系统hosts文件不见了如何解决Jun 29, 2023 pm 08:33 PM

Win10系统hosts文件不见了如何解决?在Win10系统的电脑中hosts文件是一个非常重要的文件,而最近有一些小伙伴想要修改hosts文件的时候却发现自己的hosts文件不见了,那么碰到这种情况应该怎么办呢?下面就和小编一起来看看Win10系统hosts文件不见找回办法。Win10系统hosts文件不见找回办法1、打开C:WindowsSystem32driversetc;2、打开查看选项;3、去掉隐藏受保护的操作系统文件前面的勾,然后确定;4、刷新一下,就会看到Hosts文件。

解决无法修改Win10家庭版hosts文件的方法解决无法修改Win10家庭版hosts文件的方法Jan 14, 2024 pm 06:30 PM

身为Windows10的使用者,您是否在尝试修改hosts文件时遇到无法保存更改的困境?这个文件可被视为网址域名和其对应IP地址之间的紧密联系的"数据库",那么如何巧妙地应对这种情况呢?win10家庭版hosts无法修改怎么办1.按下Ctrl+C快捷键复制以下路径:C:\Windows\System32\drivers\etc。2、在文件管理器中粘贴此路径至地址栏,右键单击hosts文件所在文件夹的右上角。3、选择“文件”菜单,选择WindowsPowerShell选项,然后会弹出一个对话框。4

hosts文件删除后果是什么hosts文件删除后果是什么Mar 09, 2023 pm 02:42 PM

hosts文件删除是没有影响的;hosts是一个没有扩展名的系统文件,可以用记事本等工具打开,其作用就是将一些常用的网址域名与其对应的IP地址建立一个关联“数据库”;当用户在浏览器中输入一个需要登录的网址时,系统会首先自动从Hosts文件中寻找对应的IP地址,一旦找到,系统会立即打开对应网页,如果没有找到,则系统会再将网址提交DNS域名解析服务器进行IP地址的解析。

最新版 PowerToys 0.64.0 已发布,其中包括文件锁定工具、Hosts 文件编辑器和设置备份。最新版 PowerToys 0.64.0 已发布,其中包括文件锁定工具、Hosts 文件编辑器和设置备份。May 08, 2023 pm 10:22 PM

微软发布了PowerToys的新功能更新。现在可以下载0.64.0版,其中包含两个全新的实用程序、设置备份和大量修复程序列表。PowerToys0.64.0引入了一个新的FileLocksmith实用程序(如下所示)。它使您可以查看哪些进程或哪些进程使用选定的文件或文件夹,从而防止它们被删除或修改。第二个新工具为编辑Hosts文件提供了一个简单方便的UI—无需再深入系统驱动器并在记事本中打开Hosts。您可以查看有关进程的详细信息,甚至在必要时结束它们。0.64.0

Linux中hosts文件位置在哪Linux中hosts文件位置在哪May 27, 2023 pm 03:22 PM

Linux中hosts文件位置hosts是一个没有扩展名的系统文件,其作用就是将一些常用的网址域名与其对应的IP地址建立一个关联“数据库”,当用户在浏览器中输入一个需要登录的网址时,系统会首先自动从Hosts文件中寻找对应的IP地址,一旦找到,系统会立即打开对应网页。对于所有Linux操作系统的发行版,hosts文件都位于: /etc/hosts拓展内容hosts文件(域名解析文件[1])是一个用于储存计算机网络中各节点信息的计算机文件。这个文件负责将主机名称映射到相应的IP地址。hosts文件

hosts文件位置在哪里hosts文件位置在哪里Feb 03, 2023 pm 02:27 PM

hosts文件位置在在“etc”文件夹中,具体查找方法是:1、从桌面进入“计算机”,双击打开“C盘”;2、依次双击打开“windows”->“System32”->“drivers”->“etc”;3、双击打开“etc”文件夹即可找到“hosts”文件。

windows hosts文件的路径是什么windows hosts文件的路径是什么Aug 31, 2022 pm 03:37 PM

hosts文件的路径是“C:\Windows\System32\drivers\etc”。hosts是一个没有扩展名的系统文件,其作用就是将一些常用的网址域名与其对应的IP地址建立一个关联“数据库”,当用户在浏览器中输入一个需要登录的网址时,系统会首先自动从Hosts文件中寻找对应的IP地址并打开对应网页;如果没有找到则系统会再将网址提交DNS域名解析服务器进行IP地址的解析。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool