##
# 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
::1 localhost
0.0.0.0 account.jetbrains.com
0.0.0.0 www.jetbrains.com
127.0.0.1:3000 www.ylcx2.shop
浏览器输入地址: www.ylcx2.shop
显示没有找到网页
怎么办?
hosts 是 DNS 解析,跟端口有啥关系?
你应该 hosts 里写:
然后浏览器里访问:
P.S. 端口号能不能省略看的是用的什么协议,HTTP 协议默认就是
80
端口、HTTPS 协议默认就是443
端口,这是 RFC 里规定好的,你可以省略。如果你是 HTTP 协议但不是80
、是 HTTPS 协议但不是443
,那么不能省略。