mac如何修改host文件
需要如何输入格式的问题
[经过版主编辑]
需要如何输入格式的问题
[经过版主编辑]
/etc/hosts文件,每一行代表一个记录;每个记录定义一个域名对应的IP地址;以#开头的行是注释行,不起作用。
具体格式:
x.x.x.x 域名
比如:
160.0.111.1 abc.net
上一行的意思是,如果访问abc.net域名,将该域名翻译为160.0.111.1的IP
macOS的原hosts内容如下(如果需要恢复,可以将其覆盖到hosts上):
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
# 0.0.0.0 swscan.apple.com
# 0.0.0.0 swdownload.apple.com
# 0.0.0.0 swcdn.apple.com
# 0.0.0.0 swquery.apple.com
::1 localhost
编辑前:
先禁止SIP
/etc/hosts文件,每一行代表一个记录;每个记录定义一个域名对应的IP地址;以#开头的行是注释行,不起作用。
具体格式:
x.x.x.x 域名
比如:
160.0.111.1 abc.net
上一行的意思是,如果访问abc.net域名,将该域名翻译为160.0.111.1的IP
macOS的原hosts内容如下(如果需要恢复,可以将其覆盖到hosts上):
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
# 0.0.0.0 swscan.apple.com
# 0.0.0.0 swdownload.apple.com
# 0.0.0.0 swcdn.apple.com
# 0.0.0.0 swquery.apple.com
::1 localhost
编辑前:
先禁止SIP
mac如何修改host文件