Kristian,我不确定这些符号的含义(例如::1),但是创建主机文件条目就像输入 IP 地址然后输入要匹配的域列表一样简单。
例如:
127.0.0.1 local localhost
将“local”和“localhost”都匹配到 127.0.0.1。您还可以执行以下操作:
127.0.0.1 local
127.0.0.1 localhost
每行一个条目 - 如果您想注释掉该行,请在每行的开头使用“#”。
Kristian, I'm not sure what those symbols mean (::1 for example), but creating host file entries is as easy as typing an IP address and then the list of domains to match.
For example:
127.0.0.1 local localhost
will match both 'local' and 'localhost' to 127.0.0.1. You could have also done the following:
127.0.0.1 local
127.0.0.1 localhost
One entry per line - use a '#' at the beginning of each line if you want to comment that line out.
发布评论
评论(2)
::1
和fe80
与对 localhost 的 IPv6 引用相关。对于像
local
这样的其他别名,只需将它们链接在一个空格分隔的列表中即可:The
::1
andfe80
relate to IPv6 references to localhost.To additional aliases like
local
, just chain them along in a space-separated list:Kristian,我不确定这些符号的含义(例如::1),但是创建主机文件条目就像输入 IP 地址然后输入要匹配的域列表一样简单。
例如:
将“local”和“localhost”都匹配到 127.0.0.1。您还可以执行以下操作:
每行一个条目 - 如果您想注释掉该行,请在每行的开头使用“#”。
Kristian, I'm not sure what those symbols mean (::1 for example), but creating host file entries is as easy as typing an IP address and then the list of domains to match.
For example:
will match both 'local' and 'localhost' to 127.0.0.1. You could have also done the following:
One entry per line - use a '#' at the beginning of each line if you want to comment that line out.