Linux 这是将主机文件修改为不解析的标题
我明白,我可以这样说:Linux 这是将主机文件修改为不解析的标题,linux,unix,url,dns,hosts,Linux,Unix,Url,Dns,Hosts,我明白,我可以这样说: 127.0.0.1 some.machine.com 进入主机文件将强制some.machine.com在本地解析 如果我不希望某个特定的url根本无法解析,该怎么办?比如说“dev/null”您可以应用相同的逻辑来否定您实际允许解析的URL解析。 例如,我阻止了 www.TechBeamers.com 使用以下条目更新主机文件: 1.1.1.1 www.TechBeamers.com 在更新主机文件之前: Pinging www.TechBeamers.com [xyz
127.0.0.1 some.machine.com
进入主机文件将强制some.machine.com在本地解析
如果我不希望某个特定的url根本无法解析,该怎么办?比如说“dev/null”您可以应用相同的逻辑来否定您实际允许解析的URL解析。 例如,我阻止了 www.TechBeamers.com 使用以下条目更新主机文件: 1.1.1.1 www.TechBeamers.com 在更新主机文件之前:
Pinging www.TechBeamers.com [xyz.xx.yy.xyz] with 32 bytes of data:
Reply from xyz.xx.yy.xyz: bytes=32 time=304ms TTL=50
Reply from xyz.xx.yy.xyz: bytes=32 time=293ms TTL=50
Pinging www.TechBeamers.com [1.1.1.1] with 32 bytes of data:
Request timed out.
Request timed out.
更新主机文件后:
Pinging www.TechBeamers.com [xyz.xx.yy.xyz] with 32 bytes of data:
Reply from xyz.xx.yy.xyz: bytes=32 time=304ms TTL=50
Reply from xyz.xx.yy.xyz: bytes=32 time=293ms TTL=50
Pinging www.TechBeamers.com [1.1.1.1] with 32 bytes of data:
Request timed out.
Request timed out.
您可以应用相同的逻辑来否定您实际允许解析的URL。 例如,我阻止了 www.TechBeamers.com 使用以下条目更新主机文件: 1.1.1.1 www.TechBeamers.com 在更新主机文件之前:
Pinging www.TechBeamers.com [xyz.xx.yy.xyz] with 32 bytes of data:
Reply from xyz.xx.yy.xyz: bytes=32 time=304ms TTL=50
Reply from xyz.xx.yy.xyz: bytes=32 time=293ms TTL=50
Pinging www.TechBeamers.com [1.1.1.1] with 32 bytes of data:
Request timed out.
Request timed out.
更新主机文件后:
Pinging www.TechBeamers.com [xyz.xx.yy.xyz] with 32 bytes of data:
Reply from xyz.xx.yy.xyz: bytes=32 time=304ms TTL=50
Reply from xyz.xx.yy.xyz: bytes=32 time=293ms TTL=50
Pinging www.TechBeamers.com [1.1.1.1] with 32 bytes of data:
Request timed out.
Request timed out.
要防止访问出站url请求,请使用防火墙iptables。。。没有立即看到这一点。要防止访问出站url请求,请使用防火墙iptables。。。没有立即看到这一点。1.1.1.1 vs 0.0.0?ip地址“0.0.0.0”用于指向默认网关或指定数据包的默认路由。它不能用作普通IP地址。“1.1.1.1”只是一个普通的公共IP地址。1.1.1.1 vs 0.0.0?IP地址“0.0.0.0”用于指向默认网关或指定数据包的默认路由。它不能用作普通IP地址。“1.1.1.1”只是一个普通的公共IP地址。