Jump to content

No longer able to block youtube through localhost. Help

DCCFan

I'd really appreciate it if someone could help. I need to block youtube on my kids' computer. It was actually blocked a few months ago. Through the localhost. Then I unblocked for a short while and when I went to block it again today I was unable to. I don't think I did anything differently this time. Could it have been a windows update that changed something? I really need to solve this. Thanks for any suggestion. 

Link to comment
Share on other sites

Link to post
Share on other sites

53 minutes ago, DCCFan said:

I'd really appreciate it if someone could help. I need to block youtube on my kids' computer. It was actually blocked a few months ago. Through the localhost. Then I unblocked for a short while and when I went to block it again today I was unable to. I don't think I did anything differently this time. Could it have been a windows update that changed something? I really need to solve this. Thanks for any suggestion. 

But why block youtube? Just wondering.

Link to comment
Share on other sites

Link to post
Share on other sites

After you made a change, you could try running the following

ipconfig /flushdns

 

sometimes windows likes remember the IP addresses

3735928559 - Beware of the dead beef

Link to comment
Share on other sites

Link to post
Share on other sites

How did you block it ? If it's from the host file it should never change by itself. Just adding "localhost www.youtube.com" should have been enough

Link to comment
Share on other sites

Link to post
Share on other sites

what oerapting system? You can set a child account on windows. 

Macos idk

Linux, create a new user account, call it child or whatever. Disable any permissions and file access you dont see fit, including program execute permission. Then block websites either using third party application like  Domain blocker or manually add urls to  /etc/hosts 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, Franck said:

How did you block it ? If it's from the host file it should never change by itself. Just adding "localhost www.youtube.com" should have been enough

I wrote: "127.0.0.1 www.youtube.com" without the quotes. It was working before but for some reason it stopped working. Will try your suggestion next. 

 

21 hours ago, wanderingfool2 said:

After you made a change, you could try running the following

ipconfig /flushdns

 

sometimes windows likes remember the IP addresses

Thanks Wandering, I tried that as well though. I'm clueless about commands but I found that suggestions searching google and tried it, sadly it didn't work either. 

 

23 hours ago, DobertRownySr said:

But why block youtube? Just wondering.

Hi Dobert, it's mostly because my 8 year old has become addicted to it. A few weeks ago when I had bronchitis and was in bed several days then on top had to study for an exam, he would spend up to 10 hours watching whatever. My mom would turn off the PC so he'd just grab a tablet, then a phone and so on. I feel like at this point it would be bad parenting not to block it. I still plan to let him watch a bit, say after dinner each day but I'm only leaving YT unblocked in one device so l have more control of it. He has access to Netflix too but has not gotten addicted to that or steam. 

 

5 hours ago, wasab said:

what oerapting system? You can set a child account on windows. 

Macos idk

Linux, create a new user account, call it child or whatever. Disable any permissions and file access you dont see fit, including program execute permission. Then block websites either using third party application like  Domain blocker or manually add urls to  /etc/hosts 

Thanks! Will look into that if I can't get it to work on localhost.

Link to comment
Share on other sites

Link to post
Share on other sites

If it is on multiple devices, you may want to maybe even consider something similar to opendns (and setting your router to use that as a dns).  I think you can setup blacklists.  Although as a note, with youtube apparently you need to block multiple websites.

 

https://support.opendns.com/hc/en-us/community/posts/115018690203-How-to-block-youtube-app

3735928559 - Beware of the dead beef

Link to comment
Share on other sites

Link to post
Share on other sites

Depending on your router, you may be able to set up a filter on your router, which would work for any machine and would be less easy to circumvent (unless your kid figures out how to sign in to the router). On my router I have the option to completely block Internet access of a machine depending on the time of day and I also have the option to black- or whitelist individual websites.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

On 12/21/2019 at 12:43 PM, DCCFan said:

Hi Dobert, it's mostly because my 8 year old has become addicted to it.

You should create your 8 year old his only user and use Windows parental controls to limit the amount of time they can spend on the devices.

 

 

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

On 12/21/2019 at 7:43 AM, DCCFan said:

I wrote: "127.0.0.1 www.youtube.com" without the quotes. It was working before but for some reason it stopped working. Will try your suggestion next. 

Unless you know how to change it, localhost should always be 127.0.0.1 so it won't work either.

Are you accessing youtube from a VPN because it would be the only reason why this rule is not working.

Link to comment
Share on other sites

Link to post
Share on other sites

On 12/23/2019 at 9:39 AM, Franck said:

Unless you know how to change it, localhost should always be 127.0.0.1 so it won't work either.

Are you accessing youtube from a VPN because it would be the only reason why this rule is not working.

Yeah it's a huge mystery to me as to how youtube is still accessible. I deleted all VPN's from the browsers (don't have a VPN program in the PC). But sadly it's still accessible. 

 

Here's the entire Hosts page (wonder if I deleted and messed up something inadvertently): 

 

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
::1             localhost
127.0.0.1       localhost
127.0.0.1       youtube.com
127.0.0.1 dailymotion.com  
127.0.0.1 gamejolt.com

127.0.0.1 youtube.com
174.142.56.12 youtube.com
119.81.98.52 youtube.com 
127.0.0.1 googlevideo.com

127.0.0.1 ytimg.com

127.0.0.1 youtube.com

127.0.0.1 youtube-ui.l.google.com

127.0.0.1 ytimg.l.google.com

127.0.0.1 ytstatic.l.google.com

127.0.0.1 youtubei.googleapis.com
127.0.0.1   www.youtube.com
127.0.0.1   208.65.153.251

Link to comment
Share on other sites

Link to post
Share on other sites

On 12/21/2019 at 6:01 PM, Eigenvektor said:

Depending on your router, you may be able to set up a filter on your router, which would work for any machine and would be less easy to circumvent (unless your kid figures out how to sign in to the router). On my router I have the option to completely block Internet access of a machine depending on the time of day and I also have the option to black- or whitelist individual websites.

 

On 12/23/2019 at 8:33 AM, vorticalbox said:

You should create your 8 year old his only user and use Windows parental controls to limit the amount of time they can spend on the devices.

 

 

Thanks so much for the suggestions. Will have to consider one of these as I'm still not able to use Hosts to block YT. Just thought of something I'm not sure whether it can be done but what if I delete the Hosts file and create a new one. Is that possible? 

 

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, DCCFan said:

Just thought of something I'm not sure whether it can be done but what if I delete the Hosts file and create a new one. Is that possible?

I'm not sure Windows will let you delete the file, but deleting all of its contents should have the same effect.

 

Make sure to keep a backup, just in case. Not sure what you're hoping this'll do/change?

 

Have you checked whether you're working on the correct file? E.g. if you add an entry for www.google.com, does it go to 127.0.0.1 instead of the website?

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

You should actually only have one entry like

127.0.0.1 youtube.com

instead of the multiple currently in your host file

 

(After you make the change do "ipconfig /flushdns".  Once you have done that, can you run "ping youtube.com" and give back those results).  Although, I have read a few articles that says that firefox doesn't honor the host file anymore.

 

You could/might want to try my suggestion from before using opendns and setting youtube as a block (since it will block for all the other devices as well).

 

Another way to block it though is this way.

IE: open internet options, goto the sites tab.  Click on restricted sites and then click sites and add youtube (youtube will still semi-load but will effectively be unusable...actually it would look like youtube broke).

Firefox: download an extension (lots out there) that will block a website

3735928559 - Beware of the dead beef

Link to comment
Share on other sites

Link to post
Share on other sites

On 12/25/2019 at 6:39 PM, DCCFan said:

127.0.0.1       localhost
127.0.0.1       youtube.com
127.0.0.1 dailymotion.com  
127.0.0.1 gamejolt.com

127.0.0.1 youtube.com
174.142.56.12 youtube.com
119.81.98.52 youtube.com 
127.0.0.1 googlevideo.com

127.0.0.1 ytimg.com

127.0.0.1 youtube.com

127.0.0.1 youtube-ui.l.google.com

127.0.0.1 ytimg.l.google.com

127.0.0.1 ytstatic.l.google.com

127.0.0.1 youtubei.googleapis.com
127.0.0.1   www.youtube.com
127.0.0.1   208.65.153.251

 

You have many redirect of Youtube this create duplicate entries. I don't know why you got 2 specific redirect to Singapore and Montreal IP's. You never need to specify the "www." either the second line what i left unchanged from the quote is more than enough.

 

Note that is you use VPN browser like TOR (as the most common on doing this) it will bypass all these rules inside the host file

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×