OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 23.1 Legacy Series »
  • Blocking specific TLD
« previous next »
  • Print
Pages: [1]

Author Topic: Blocking specific TLD  (Read 3596 times)

Vilhonator

  • Full Member
  • ***
  • Posts: 245
  • Karma: 13
    • View Profile
Blocking specific TLD
« on: May 19, 2023, 05:54:06 pm »
Don't know how many are aware, but google just released bunch of new TLDs (or at least started advertise them) couple of days ago.

Among those TLDs were .zip (yes, DOT ZIP) and .mov TLDs. So my question is, is there a way to setup alias to collect all .zip domains or setup unbound to block them?
Logged

CJ

  • Hero Member
  • *****
  • Posts: 832
  • Karma: 30
    • View Profile
    • Have Answer, Will Blog
Re: Blocking specific TLD
« Reply #1 on: May 19, 2023, 06:34:24 pm »
From what little I've seen the only way to do so involves either messing with the unbound config files or running a different/additional dns server.

Your best bet is to put in a feature request for it.
Logged
Have Answer, Will Blog

lilsense

  • Hero Member
  • *****
  • Posts: 600
  • Karma: 19
    • View Profile
Re: Blocking specific TLD
« Reply #2 on: May 19, 2023, 07:43:47 pm »
I use pihole to do this with regex. :)

something like this:
\.(zip|mov)$
« Last Edit: May 19, 2023, 07:45:24 pm by lilsense »
Logged

Vilhonator

  • Full Member
  • ***
  • Posts: 245
  • Karma: 13
    • View Profile
Re: Blocking specific TLD
« Reply #3 on: May 20, 2023, 12:00:29 pm »
Quote from: lilsense on May 19, 2023, 07:43:47 pm
I use pihole to do this with regex. :)

something like this:
\.(zip|mov)$

Yea that was first thing I looked into, but I'm looking for option to block something that runs on my OpnSense, since I would have to un-install OpnSense and replace it with something that supports pi-hole and that's not going to happen.

Might have to check if SNORT or Suricata has that option
Logged

lilsense

  • Hero Member
  • *****
  • Posts: 600
  • Karma: 19
    • View Profile
Re: Blocking specific TLD
« Reply #4 on: May 20, 2023, 12:32:56 pm »
no need to uninstall OPNsense. you can install bhyve and run a pihole vm on the OPNsense similar to the OpenWRT discussion on this forum.

ref:
Bhyve on OPNsense for virtualization in 2023
HOWTO: Setup OpenWRT Virtual Machine on OPNsense and use it to manage a WiFi AP
Logged

spacecase-25

  • Newbie
  • *
  • Posts: 22
  • Karma: 0
    • View Profile
Re: Blocking specific TLD
« Reply #5 on: May 20, 2023, 10:16:00 pm »
How can this be done without installing pihole?
Logged

zan

  • Full Member
  • ***
  • Posts: 175
  • Karma: 31
    • View Profile
Re: Blocking specific TLD
« Reply #6 on: May 21, 2023, 06:23:03 am »
Easiest way in unbound is create domain override for 'zip' and point it to blackhole.

In AdGuardHome you can put this in Filter>Custom filtering rules:
Code: [Select]
||*.zip^
Logged

JasMan

  • Full Member
  • ***
  • Posts: 175
  • Karma: 9
    • View Profile
Re: Blocking specific TLD
« Reply #7 on: May 28, 2023, 04:12:48 pm »
I had the same question, and I found a solution (more a workaround) by adding a domain override into Unbound.

1. Go to Services: Unbound DNS: Overrides -> Domain Overrides
2. Add a new entry with the following values
    Domain: zip
    IP: 0.0.0.0

This will forward all domain queries for the TLD zip to the nameserver IP 0.0.0.0, and the queries will run into a timeout.
If you experience performance issues due to waiting for the timeout, you can change the IP to an existing internal IP, which refuse (not block!) DNS queries on port 53.

A query forwarding will also work (Services: Unbound DNS: Query Forwarding).
Logged
Duck, Duck, Duck, Duck, Duck, Duck, Duck, Duck, Goose

CJ

  • Hero Member
  • *****
  • Posts: 832
  • Karma: 30
    • View Profile
    • Have Answer, Will Blog
Re: Blocking specific TLD
« Reply #8 on: June 01, 2023, 04:27:28 pm »
Quote from: JasMan on May 28, 2023, 04:12:48 pm
I had the same question, and I found a solution (more a workaround) by adding a domain override into Unbound.

1. Go to Services: Unbound DNS: Overrides -> Domain Overrides
2. Add a new entry with the following values
    Domain: zip
    IP: 0.0.0.0

This will forward all domain queries for the TLD zip to the nameserver IP 0.0.0.0, and the queries will run into a timeout.
If you experience performance issues due to waiting for the timeout, you can change the IP to an existing internal IP, which refuse (not block!) DNS queries on port 53.

A query forwarding will also work (Services: Unbound DNS: Query Forwarding).

Nice.  I like it.
Logged
Have Answer, Will Blog

Kawachiller

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 2
    • View Profile
Re: Blocking specific TLD
« Reply #9 on: June 06, 2023, 12:20:54 am »
Thx for the solution!

Quote from: JasMan on May 28, 2023, 04:12:48 pm
I had the same question, and I found a solution (more a workaround) by adding a domain override into Unbound.

1. Go to Services: Unbound DNS: Overrides -> Domain Overrides
2. Add a new entry with the following values
    Domain: zip
    IP: 0.0.0.0

This will forward all domain queries for the TLD zip to the nameserver IP 0.0.0.0, and the queries will run into a timeout.
If you experience performance issues due to waiting for the timeout, you can change the IP to an existing internal IP, which refuse (not block!) DNS queries on port 53.

A query forwarding will also work (Services: Unbound DNS: Query Forwarding).
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 23.1 Legacy Series »
  • Blocking specific TLD
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2