当前位置: 首页 >  电脑打不开网站是什么原因?排查本地Hosts拦截与防火墙误杀全攻略

电脑打不开网站是什么原因?排查本地Hosts拦截与防火墙误杀全攻略

电脑打不开网站是什么原因?排查本地Hosts拦截与防火墙误杀全攻略1

电脑打不开网站可能有多种原因,以下是一些常见的排查步骤和解决方案:
1. 检查本地Hosts文件:
- 打开记事本或其他文本编辑器。
- 输入`127.0.0.1 example.com`(将`example.com`替换为你想要访问的网站)。
- 保存并关闭文件。
- 重启计算机。
2. 检查防火墙设置:
- 以管理员身份运行命令提示符或PowerShell。
- 输入`netsh advfirewall firewall add rule name="HTTP" dir=in action=allow protocol=TCP localport=80`(将`HTTP`替换为你想要访问的网站协议,如`HTTP`、`HTTPS`等)。
- 输入`netsh advfirewall firewall add rule name="HTTPS" dir=in action=allow protocol=TLS localport=443`(将`HTTPS`替换为你想要访问的网站协议,如`HTTPS`、`HTTPS/TLS`等)。
- 输入`netsh advfirewall firewall add rule name="FTP" dir=in action=allow protocol=TCP localport=21`(将`FTP`替换为你想要访问的网站协议,如`FTP`、`FTPS`等)。
- 输入`netsh advfirewall firewall add rule name="SSH" dir=in action=allow protocol=TCP localport=22`(将`SSH`替换为你想要访问的网站协议,如`SSH`、`SSH/TLS`等)。
- 输入`netsh advfirewall firewall add rule name="RDP" dir=in action=allow protocol=TCP localport=3389`(将`RDP`替换为你想要访问的网站协议,如`RDP`、`RDP/Tcp`等)。
- 输入`netsh advfirewall firewall add rule name="VPN" dir=in action=allow protocol=TCP localport=53`(将`VPN`替换为你想要访问的网站协议,如`VPN`、`VPN/TLS`等)。
- 输入`netsh advfirewall firewall add rule name="WebRTC" dir=in action=allow protocol=UDP localport=8080`(将`WebRTC`替换为你想要访问的网站协议,如`WebRTC`、`RTC/STUN/ICE`等)。
- 输入`netsh advfirewall firewall add rule name="WebSocket" dir=in action=allow protocol=UDP localport=8081`(将`WebSocket`替换为你想要访问的网站协议,如`WebSocket`、`wss://*:80/wssocket`等)。
- 输入`netsh advfirewall firewall add rule name="IMAP" dir=in action=allow protocol=TCP localport=143(将`IMAP`替换为你想要访问的网站协议,如`IMAP`、`imap.example.com`等)。
- 输入`netsh advfirewall firewall add rule name="POP3" dir=in action=allow protocol=TCP localport=110(将`POP3`替换为你想要访问的网站协议,如`POP3`、`pop.example.com`等)。
- 输入`netsh advfirewall firewall add rule name="SMB" dir=in action=allow protocol=TCP localport=137,138,139,445,443,3389,3394,3388,3386,3387,3385,3384,3383,3382,3381,3379,3378,3377,3376,3375,3374,3373,3372,3371,3369,3368,3367,3366,3365,3364,3363,3362,3361,3360,3359,3358,3357,3356,3355,3354,3353,3352,3351,3350,3349,3348,3347,3346,3345,3344,3343,3342,3341,3340,3339,3338,3337,3336,3335,3334,3333,3332,3331,3330,3329,3328,3327,3326,3325,3324,3323,3322,3321,3320,3319,3318,3317,3316,3315,3314,3313,3312,3311,3310,3309,3308,3307,3306,3305,3304,3303,3302,3301,3299,3298,3297,3296,3295,3294,3293,3292,3291,3290,3289,3288,3287,3286,3285,3284,3283,3282,3281,3280,3279,3278,3277,3276,3275,3274,3273,3272,3271,3270,3269,3268,3267,3266,3265,3264,3263,3262,3261,3260,3259,3258,3257,3256,3255,3254,3253,3252,3251,3250,3249,3248,3247,3246,3245,3244,3243,3242,3241,3240,3239,3238,3237,3236,3235,3234,3233,3232,3231,3230,3229,3228,3227,3226,3225,3224,3223,3222,3221,3220,3219,3218,3217,3216,3215,3214,3213,3212,3211,3210,3209,3208,3207,3206,3205,3204,3203,3202,3201,3200,(将``替换为你想要访问的网站协议,如``、`http://www.example.com`等)。
- 输入`netsh int ipv4 show excludedranges`(将`excludedranges`替换为你想要查看的排除范围,如`excludedranges=192.168.1.0/24`等)。
如果以上方法都无法解决问题,你可以尝试以下步骤:
1. 检查网络连接:确保你的计算机已连接到互联网,并且网络是活跃的。
2. 检查防火墙设置:使用其他设备或软件检查防火墙设置,确保没有阻止访问网站的端口。
3. 检查IP地址和DNS设置:确保你的计算机的IP地址和DNS服务器设置正确。
4. 检查浏览器插件和扩展:有些浏览器插件或扩展可能会阻止访问某些网站。尝试禁用它们,然后再次尝试访问网站。
5. 检查系统还原点:如果你最近进行了系统还原,可能会导致无法访问某些网站。尝试创建一个新还原点,然后重新启动计算机。
6. 检查杀毒软件和防火墙:确保你的杀毒软件和防火墙没有错误地阻止了网站访问。有时,这些工具可能会误报或限制某些网站的访问。
如果上述方法都无法解决问题,你可能需要寻求专业的技术支持,或者考虑重新安装操作系统和必要的软件。
返回顶部