작동하지 않는 사이트를 차단하기 위해 호스트 파일 편집

작동하지 않는 사이트를 차단하기 위해 호스트 파일 편집

내 파일에 다음 줄을 넣었습니다 C:\Windows\System32\drivers\etc\hosts.

127.0.0.1 www.cnn.com
127.0.0.1 cnn.com
127.0.0.1 facebook.com
127.0.0.1 www.facebook.com
127.0.0.1 www.hotnews.ro
127.0.0.1 hotnews.ro

그리고 나는 여전히 이러한 웹사이트에 접속할 수 있습니다.

컴퓨터를 다시 시작하고 캐시를 지웠으며 다른 브라우저를 사용해도 아무것도 작동하지 않습니다.

프록시를 사용하지 않습니다. 저는 Windows 7/64비트를 사용하고 있습니다.

DNS를 플래시했습니다. ipconfig /flushdnscnn.com을 핑하면 다음에서 응답을 받습니다.157.166.226.25

또 무엇을 할 수 있나요? 어쩌면 호스트를 수정하고 작동할 수 있는 프로그램이 있을 수도 있습니다.

답변1

사이트를 차단하려면 모든 도메인 이름을 나열해야 합니다. Facebook이나 YouTube와 같은 사이트의 경우 이름과 IP 주소가 엄청나게 많은 목록입니다. 아래 유튜브 차단에 사용한 코드를 복사해 두겠습니다.

Subdomain   IP Address
127.0.0.1   host.youtube.com    
127.0.0.1   198.105.244.63
127.0.0.1   host.youtube.com    
127.0.0.1   198.105.254.63
127.0.0.1   mx.youtube.com  
127.0.0.1   216.58.192.206
127.0.0.1   mx.youtube.com  
127.0.0.1   216.58.192.238
127.0.0.1   mx.youtube.com  
127.0.0.1   172.217.0.14
127.0.0.1   mx.youtube.com  
127.0.0.1   172.217.6.14
127.0.0.1   mx.youtube.com  
127.0.0.1   172.217.9.46
127.0.0.1   mx.youtube.com  
127.0.0.1   216.58.192.174
127.0.0.1   172.217.6.110   
127.0.0.1   172.217.4.46
127.0.0.1   172.217.1.46    
127.0.0.1   172.217.8.174
127.0.0.1   172.217.8.206
127.0.0.1   216.58.192.142
127.0.0.1   216.58.216.78
127.0.0.1   172.217.4.78
127.0.0.1   216.58.216.238
127.0.0.1   74.125.126.129
127.0.0.1   198.105.244.63
127.0.0.1   198.105.254.63
127.0.0.1   198.105.244.63
127.0.0.1   198.105.254.63
127.0.0.1   mx.youtube.com  
127.0.0.1   2607:f8b0:4009:803:0:0:0:200e
127.0.0.1   admin.youtube.com   
127.0.0.1   2607:f8b0:4001:c1d:0:0:0:81
127.0.0.1   http.youtube.com    
127.0.0.1   198.105.244.63
127.0.0.1   http.youtube.com    
127.0.0.1   198.105.254.63
127.0.0.1   mx0.youtube.com 
127.0.0.1   198.105.244.63
127.0.0.1   mx0.youtube.com 
127.0.0.1   198.105.254.63
127.0.0.1   administration.youtube.com  
127.0.0.1   198.105.244.63
127.0.0.1   administration.youtube.com  
127.0.0.1   198.105.254.63
127.0.0.1   development.youtube.com 
127.0.0.1   198.105.244.63
127.0.0.1   development.youtube.com 
127.0.0.1   198.105.254.63
127.0.0.1   svn.youtube.com 
127.0.0.1   198.105.244.63
127.0.0.1   svn.youtube.com 
127.0.0.1   198.105.254.63
127.0.0.1   id.youtube.com  
127.0.0.1   198.105.244.63
127.0.0.1   id.youtube.com  
127.0.0.1   198.105.254.63
127.0.0.1   mx1.youtube.com 
127.0.0.1   198.105.244.63  
127.0.0.1   mx1.youtube.com 
127.0.0.1   198.105.254.63
127.0.0.1   ads.youtube.com 
127.0.0.1   172.217.8.174
127.0.0.1   devsql.youtube.com  
127.0.0.1   198.105.244.63
127.0.0.1   devsql.youtube.com  
127.0.0.1   198.105.254.63
127.0.0.1   syslog.youtube.com  
127.0.0.1   198.105.244.63
127.0.0.1   syslog.youtube.com  
127.0.0.1   198.105.254.63
127.0.0.1   ads.youtube.com 
127.0.0.1   2607:f8b0:4001:c1d:0:0:0:66
127.0.0.1   adserver.youtube.com    
127.0.0.1   198.105.244.63
127.0.0.1   adserver.youtube.com    
127.0.0.1   198.105.254.63
127.0.0.1   images.youtube.com  
127.0.0.1   198.105.244.63
127.0.0.1   images.youtube.com  
127.0.0.1   198.105.254.63
127.0.0.1   mysql.youtube.com   
127.0.0.1   198.105.244.63
127.0.0.1   mysql.youtube.com   
127.0.0.1   198.105.254.63
127.0.0.1   devtest.youtube.com 
127.0.0.1   198.105.244.63
127.0.0.1   devtest.youtube.com 
127.0.0.1   198.105.254.63
127.0.0.1   info.youtube.com    
127.0.0.1   198.105.244.63
127.0.0.1   info.youtube.com    
127.0.0.1   198.105.254.63
127.0.0.1   news.youtube.com    
127.0.0.1   172.217.9.46
127.0.0.1   news.youtube.com    
127.0.0.1   216.58.192.174
127.0.0.1   news.youtube.com    
127.0.0.1   172.217.6.110
127.0.0.1   news.youtube.com
127.0.0.1   172.217.4.46
127.0.0.1   news.youtube.com    
127.0.0.1   172.217.1.46
127.0.0.1   news.youtube.com    
127.0.0.1   172.217.8.174
127.0.0.1   news.youtube.com    
127.0.0.1   172.217.8.206
127.0.0.1   news.youtube.com    
127.0.0.1   216.58.192.142
127.0.0.1   news.youtube.com    
127.0.0.1   216.58.216.78
127.0.0.1   news.youtube.com    
127.0.0.1   172.217.4.78
127.0.0.1   news.youtube.com    
127.0.0.1   216.58.216.238
127.0.0.1   news.youtube.com    
127.0.0.1   216.58.192.206
127.0.0.1   news.youtube.com    
127.0.0.1   216.58.192.238
127.0.0.1   news.youtube.com    
127.0.0.1   172.217.0.14
127.0.0.1   news.youtube.com    
127.0.0.1   172.217.6.14
127.0.0.1   alerts.youtube.com  
127.0.0.1   198.105.244.63
127.0.0.1   alerts.youtube.com  
127.0.0.1   198.105.254.63
127.0.0.1   dhcp.youtube.com    
127.0.0.1   198.105.244.63
127.0.0.1   dhcp.youtube.com    
127.0.0.1   198.105.254.63
127.0.0.1   test1.youtube.com   
127.0.0.1   198.105.244.63
127.0.0.1   test1.youtube.com   
127.0.0.1   198.105.254.63
127.0.0.1   news.youtube.com    
127.0.0.1   2607:f8b0:4009:803:0:0:0:200e
127.0.0.1   internal.youtube.com    
127.0.0.1   198.105.244.63
127.0.0.1   internal.youtube.com    
127.0.0.1   198.105.254.63
127.0.0.1   noc.youtube.com 
127.0.0.1   198.105.244.63
127.0.0.1   noc.youtube.com 
127.0.0.1   198.105.254.63
127.0.0.1   alpha.youtube.com   
127.0.0.1   198.105.244.63
127.0.0.1   alpha.youtube.com   
127.0.0.1   198.105.254.63
127.0.0.1   direct.youtube.com  
127.0.0.1   198.105.244.63
127.0.0.1   direct.youtube.com  
127.0.0.1   198.105.254.63
127.0.0.1   test2.youtube.com   
127.0.0.1   198.105.244.63  
127.0.0.1   test2.youtube.com   
127.0.0.1   198.105.254.63
127.0.0.1   internet.youtube.com    
127.0.0.1   198.105.244.63
127.0.0.1   internet.youtube.com    
127.0.0.1   198.105.254.63
127.0.0.1   ns.youtube.com  
127.0.0.1   198.105.244.63
127.0.0.1   ns.youtube.com  
127.0.0.1   198.105.254.63
127.0.0.1   ap.youtube.com  
127.0.0.1   198.105.244.63
127.0.0.1   ap.youtube.com  
127.0.0.1   198.105.254.63
127.0.0.1   dmz.youtube.com 
127.0.0.1   198.105.244.63
127.0.0.1   dmz.youtube.com 
127.0.0.1   198.105.254.63
127.0.0.1   testing.youtube.com 
127.0.0.1   198.105.244.63
127.0.0.1   testing.youtube.com 
127.0.0.1   198.105.254.63
127.0.0.1   intra.youtube.com   
127.0.0.1   198.105.244.63
127.0.0.1   intra.youtube.com   
127.0.0.1   198.105.254.63
127.0.0.1   ns0.youtube.com 
127.0.0.1   198.105.244.63
127.0.0.1   ns0.youtube.com 
127.0.0.1   198.105.254.63
127.0.0.1   apache.youtube.com  
127.0.0.1   198.105.244.63
127.0.0.1   apache.youtube.com  
127.0.0.1   198.105.254.63
127.0.0.1   dns.youtube.com 
127.0.0.1   198.105.244.63
127.0.0.1   dns.youtube.com 
127.0.0.1   198.105.254.63
127.0.0.1   upload.youtube.com  
127.0.0.1   172.217.8.175
127.0.0.1   upload.youtube.com
127.0.0.1   2607:f8b0:4009:803:0:0:0:200f
127.0.0.1   intranet.youtube.com    
127.0.0.1   198.105.244.63
127.0.0.1   intranet.youtube.com    
127.0.0.1   198.105.254.63
127.0.0.1   ns1.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   ns1.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   app.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   app.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   dns0.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   dns0.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   vm.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   vm.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   ipv6.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   ipv6.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   ns2.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   ns2.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   apps.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   apps.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   dns1.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   dns1.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   vnc.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   vnc.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   lab.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   lab.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   ns3.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   ns3.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   appserver.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   appserver.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   dns2.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   dns2.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   ldap.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   ldap.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   aptest.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   aptest.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   download.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   download.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   vpn.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   vpn.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   linux.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   linux.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   ops.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   ops.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   auth.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   auth.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   en.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   en.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   web.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   web.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   local.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   local.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   oracle.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   oracle.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   backup.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   backup.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   erp.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   erp.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   web2test.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   web2test.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   log.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   log.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   owa.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   owa.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   beta.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   beta.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   eshop.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   eshop.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   whois.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   whois.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   pbx.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   pbx.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   blog.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   blog.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   exchange.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   exchange.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   wiki.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   wiki.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   www.youtube.com
127.0.0.1   172.217.8.174
127.0.0.1   www.youtube.com
127.0.0.1   172.217.8.206
127.0.0.1   www.youtube.com
127.0.0.1   216.58.192.142
127.0.0.1   www.youtube.com
127.0.0.1   216.58.216.78
127.0.0.1   www.youtube.com
127.0.0.1   172.217.4.78
127.0.0.1   www.youtube.com
127.0.0.1   216.58.216.238
127.0.0.1   www.youtube.com
127.0.0.1   216.58.192.206
127.0.0.1   www.youtube.com
127.0.0.1   216.58.192.238
127.0.0.1   www.youtube.com
127.0.0.1   172.217.0.14
127.0.0.1   www.youtube.com
127.0.0.1   172.217.6.14
127.0.0.1   www.youtube.com
127.0.0.1   172.217.9.46
127.0.0.1   www.youtube.com
127.0.0.1   216.58.192.174
127.0.0.1   www.youtube.com
127.0.0.1   172.217.6.110
127.0.0.1   www.youtube.com
127.0.0.1   172.217.4.46
127.0.0.1   www.youtube.com
127.0.0.1   172.217.1.46
127.0.0.1   s3.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   s3.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   f5.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   f5.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   www.youtube.com
127.0.0.1   2607:f8b0:4009:803:0:0:0:200e
127.0.0.1   secure.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   secure.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   chat.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   chat.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   fileserver.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   fileserver.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   www2.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   www2.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   server.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   server.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   citrix.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   citrix.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   firewall.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   firewall.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   xml.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   xml.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   main.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   main.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   shop.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   shop.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   cms.youtube.com
127.0.0.1   172.217.8.174
127.0.0.1   forum.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   forum.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   cms.youtube.com
127.0.0.1   2607:f8b0:4001:c1d:0:0:0:66
127.0.0.1   manage.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   manage.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   sip.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   sip.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   corp.youtube.com
127.0.0.1   74.125.126.129
127.0.0.1   corp.youtube.com
127.0.0.1   2607:f8b0:4001:c1d:0:0:0:81
127.0.0.1   mgmt.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   mgmt.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   crs.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   crs.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   mirror.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   mirror.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   sql.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   sql.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   cvs.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   cvs.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   git.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   git.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   mobile.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   mobile.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   squid.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   squid.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   database.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   database.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   gw.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   gw.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   help.youtube.com
127.0.0.1   172.217.12.100
127.0.0.1   monitor.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   monitor.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   ssh.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   ssh.youtube.com     
127.0.0.1   198.105.254.63
127.0.0.1   db.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   db.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   help.youtube.com
127.0.0.1   2607:f8b0:4002:811:0:0:0:2004
127.0.0.1   mssql.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   mssql.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   ssl.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   ssl.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   demo.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   demo.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   helpdesk.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   helpdesk.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   mta.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   mta.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   dev.youtube.com
127.0.0.1   198.105.244.63
127.0.0.1   dev.youtube.com
127.0.0.1   198.105.254.63
127.0.0.1   home.youtube.com
127.0.0.1   198.105.244.63

답변2

이것이 귀하의 문제를 해결할지는 확실하지 않지만 몇 가지 제안 사항은 다음과 같습니다.

  • 파일에 있을 수 있는 확장자를 제거하세요.
  • 파일 어딘가(가급적 상단)에 이 줄이 있는지 확인하세요.

    127.0.0.1 localhost

편집: localhost가 아닌 localhost여야 합니다(끝에 's'가 없음).

편집 2: 다음은 serverfault에 대한 호스트 파일 관련 정보의 전체 목록입니다. 아마도 도움이 될 것입니다:https://serverfault.com/questions/452268/hosts-file-ignored-how-to-troubleshoot

답변3

가능한 문제, 파일 손상. 편집기(메모장)에서 .txt 확장자로 저장합니다. 잘못된 파일 위치를 편집하고 있습니다. 이러한 문제를 다루기 위해

  • 현재 호스트 파일 이름 바꾸기

그런 다음 메모장 %SystemRoot%\System32\drivers\etc\hosts를 사용하십시오.

올바른 파일을 얻으려면 목록에서 한 줄을 입력하고 폴더를 저장하고 확인한 다음 .txt로 저장하지 않았는지 확인한 다음 핑으로 시도해 보세요.

관련 정보