Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Domain override for .onion domains not possible

    Scheduled Pinned Locked Moved DHCP and DNS
    3 Posts 2 Posters 1.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      Daniel Abrecht
      last edited by

      I have a tor service running on a vm in one of my subnets, which I use as default gateway & dns for all PCs and VMs in the same subnet in order to route all internet traffic through the tor network. The VM running the torservice uses the pfSense firewall as default gateway. Every other PC in that subnet is blocked from using the pfSense firewall as gateway using a firewall rule. I use tor this way in order to prevent any application from circumventing the tor socks proxy.

      My LAN and DMZ networks are in a subnet different from the one containing those PCs and VMs. A lot of Linux distributions offer a .onion address for their repositories, debian and devuan for example. As I understand Tor, those services offer an anonymized end to end encrypted connection to those repositories. I therefore would like to use suche a connection for each of my server in order to make updates even more secure, especially since some apt-keys in debian use cyphers which aren't that secure anymore nowadays.

      Therefore, aside from a few other things, I added a domain override to my DNS server for .onion domains, but it didn't work. Other TLDs work just fine, but I need that specific TLD in this case. I checked with tcpdump and dig if the DNS queries are sent from pfSense to the DNS Server, and it was only the case with TLD domain overrieds and TLDs other than .onion. This worked once with pfSense 2.2.x, and I think this behavior was introduced with pfSense 2.3. I suspect that this may have been in order to prevent DNS Leaking in case of .onion domains, which have been assigned as special use domain by iana. There is also rfc7686 which seams to be consistent with what pfSense does.

      How can I let pfSense resolve .onion domains anyway?

      1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator
        last edited by

        yes unbound has defaults for onion and will just return

        ;; QUESTION SECTION:
        ;test.domain.onion.            IN      A

        ;; AUTHORITY SECTION:
        onion.                  10800  IN      SOA    localhost. nobody.invalid. 1 3600 1200 604800 10800

        You can override this with the statement
        local-zone: "onion." nodefault

        In your advanced custom box in the resolver.
        Most likely you will need the
        server:
        Statement first if you don't already have it.  Then you can create your override for onion. in your domain override section.. So I did not want to spend the time to fire up an authoritative server for onion tld, etc.  But I did validate that unbound will then forward this query to where you say to query.. So I pointed that override to another IP on my network 192.168.9.40, he is not going to answer any dnsquery but you can see from a packet capture unbound sent the query there..

        onionoverride.jpg
        onionoverride.jpg_thumb

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        1 Reply Last reply Reply Quote 0
        • D
          Daniel Abrecht
          last edited by

          Thanks. It works like a charm.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.