Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New User : Unable to block youtube.com and facebook.com domains using blocky. #1453

Open
developer-scogo opened this issue Apr 18, 2024 · 4 comments
Labels
👋 help wanted Extra attention is needed

Comments

@developer-scogo
Copy link

Hi i am a new blocky user and having troubles to setup the blocklist, i am sure i am missing something basic.

I have very simple use case, i need to block youtube.com and facebook.com domains using blocky.
Here is the current config file i am using to configure blocky.

After applying the below config and running blocky and trying to open
youtube.com and facebook.com , i am able to visit/view both websites. i.e Blocky is not blocking the 2 domains that i have asked it to block.

  • config.yml
upstream:
  default:
    - 1.1.1.1
    - 8.8.8.8
blocking:
  blackLists:
    ads:
      - https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
      - https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
      - http://sysctl.org/cameleon/hosts
      - https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
      - |
        # inline definition with YAML literal block scalar style
        someadsdomain.com
        *.example.com
        youtube.com
        facebook.com
    fakenews:
      - https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-only/hosts
    gambling:
      - https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-only/hosts

  clientGroupsBlock:
    default:
      - ads
  loading:
    downloads:
      timeout: 4m
  blockType: nxDomain
  blockTTL: 1m
ports:
  dns: 53
  http: 4000
  • Here are the logs that you might be interested in
[2024-04-18 18:46:05]  INFO queryLog: query resolved answer=AAAA (::) client_ip=45.127.44.82 client_names=45.127.44.82 duration_ms=0 hostname=bb7be7d9b0a7 question_name=facebook.com. question_type=AAAA response_code=NOERROR response_reason=BLOCKED (ads) response_type=BLOCKED
[2024-04-18 18:46:05]  INFO queryLog: query resolved answer= client_ip=45.127.44.82 client_names=45.127.44.82 duration_ms=0 hostname=bb7be7d9b0a7 question_name=facebook.com. question_type=HTTPS response_code=NXDOMAIN response_reason=BLOCKED (ads) response_type=BLOCKED
[2024-04-18 18:46:05]  INFO queryLog: query resolved answer=A (0.0.0.0) client_ip=45.127.44.82 client_names=45.127.44.82 duration_ms=0 hostname=bb7be7d9b0a7 question_name=facebook.com. question_type=A response_code=NOERROR response_reason=BLOCKED (ads) response_type=BLOCKED


[2024-04-18 18:46:05]  INFO queryLog: query resolved answer=CNAME (star-mini.c10r.facebook.com.), A (31.13.79.35) client_ip=45.127.44.82 client_names=45.127.44.82 duration_ms=3 hostname=bb7be7d9b0a7 question_name=www.facebook.com. question_type=A response_code=NOERROR response_reason=RESOLVED (tcp+udp:8.8.8.8) response_type=RESOLVED
[2024-04-18 18:46:05]  INFO queryLog: query resolved answer=CNAME (star-mini.c10r.facebook.com.), AAAA (2a03:2880:f188:84:face:b00c:0:25de) client_ip=45.127.44.82 client_names=45.127.44.82 duration_ms=4 hostname=bb7be7d9b0a7 question_name=www.facebook.com. question_type=AAAA response_code=NOERROR response_reason=RESOLVED (tcp+udp:1.1.1.1) response_type=RESOLVED
[2024-04-18 18:46:05]  INFO queryLog: query resolved answer=CNAME (star-mini.c10r.facebook.com.) client_ip=45.127.44.82 client_names=45.127.44.82 duration_ms=4 hostname=bb7be7d9b0a7 question_name=www.facebook.com. question_type=HTTPS response_code=NOERROR response_reason=RESOLVED (tcp+udp:1.1.1.1) response_type=RESOLVED
[2024-04-18 18:46:05]  INFO queryLog: query resolved answer=CNAME (scontent.xx.fbcdn.net.) client_ip=45.127.44.82 client_names=45.127.44.82 duration_ms=4 hostname=bb7be7d9b0a7 question_name=static.xx.fbcdn.net. question_type=HTTPS response_code=NOERROR response_reason=RESOLVED (tcp+udp:1.1.1.1) response_type=RESOLVED
  • Is there anything missing in the configuration file ?
@kwitsch
Copy link
Collaborator

kwitsch commented Apr 18, 2024

You are blocking facebook.com but not *.facebook.com so www.facebook.com isn't blocked (which is also stated in the logs 😉).

Further since it seems that you are using Apple devices consider filtering HTTPS requests since they mess up some blocks and aren't necessary to resolve.

@kwitsch kwitsch added the 👋 help wanted Extra attention is needed label Apr 18, 2024
@developer-scogo
Copy link
Author

@kwitsch Thanks for the pointer , i was just missing 2 characters to get it working

  • BTW instead of this error message , is there a way in blocky to show a custom message something like "As per the policy of this network, access to this website is blocked" ? . May be possibility of adding a custom HTML page or redirecting it to another website that can show this message. ?
image

@developer-scogo
Copy link
Author

Oho got it

blockType : 
  custom IPs

Should do it

@kwitsch
Copy link
Collaborator

kwitsch commented Apr 19, 2024

Remember that you most likely see an SSL error page in your browser if IP blocking is used since the certificate will be mismatched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👋 help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants