Setup Unbound with localhost as basic DNS

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
havanaboy11
Posts: 3
Joined: Mon Oct 21, 2019 4:04 pm

Setup Unbound with localhost as basic DNS

Post by havanaboy11 »

I'm currently trying to setup Unbound with censor-free 0-logging DNS-Servers. I tried multiple tutorials, but it seems like Unbound is still using my Routers DNS by default and not the specified ones. Since i'm currently on a network with other people and can't consent the change in the router, i just want to use the Pi with Unbound + Pi-Hole manually with a couple of devices.

In the following the results i observe:

Code: Select all

dig google.de @127.0.0.1 -p 5353
results in

Code: Select all

SERVER: 127.0.0.1#5335(127.0.0.1)
while

Code: Select all

dig google.de
give me

Code: Select all

SERVER: 192.168.2.1#53(192.168.2.1)

here are my current unbound configs:
/etc/unbound/unbound.conf.d/pi-hole.conf

Code: Select all

server:
    # If no logfile is specified, syslog is used
    # logfile: "/var/log/unbound/unbound.log"
    verbosity: 0

    interface: 127.0.0.1
    #interface: 0.0.0.0
    port: 5335
    do-ip4: yes
    do-udp: yes
    do-tcp: yes

    # May be set to yes if you have IPv6 connectivity
    do-ip6: yes

    # You want to leave this to no unless you have *native* IPv6. With 6to4 and
    # Terredo tunnels your web browser should favor IPv4 for the same reasons
    prefer-ip6: no

    # Use this only when you downloaded the list of primary root servers!
    # If you use the default dns-root-data package, unbound will find it automatically
    root-hints: "/var/lib/unbound/root.hints"
        # Trust glue only if it is within the server's authority
    harden-glue: yes

    # Require DNSSEC data for trust-anchored zones, if such data is absent, the zone becomes BOGUS
    harden-dnssec-stripped: yes

    # Don't use Capitalization randomization as it known to cause DNSSEC issues sometimes
    # see https://discourse.pi-hole.net/t/unbound-stubby-or-dnscrypt-proxy/9378 for further details
    use-caps-for-id: no

    # Reduce EDNS reassembly buffer size.
    # Suggested by the unbound man page to reduce fragmentation reassembly problems
    edns-buffer-size: 1472

    # TTL bounds for cache
    cache-min-ttl: 3600
    cache-max-ttl: 86400


    # Perform prefetching of close to expired message cache entries
    # This only applies to domains that have been frequently queried
        prefetch: yes

    # One thread should be sufficient, can be increased on beefy machines. In reality for most users running on small networks or on a single machine, it should be unnecessary to seek pe$
    num-threads: 1

    # Ensure kernel buffer is large enough to not lose messages in traffic spikes
    so-rcvbuf: 1m

    # Ensure privacy of local IP ranges
    private-address: 192.168.0.0/16
    private-address: 169.254.0.0/16
    private-address: 172.16.0.0/12
    private-address: 10.0.0.0/8
    private-address: fd00::/8
    private-address: fe80::/10
/etc/unbound/unbound.conf.d/tls-forwarding.conf

Code: Select all

server:
  tls-cert-bundle: /etc/ssl/certs/ca-certificates.crt

forward-zone:
  name: "."
  forward-tls-upstream: yes
  # Quad9
  forward-addr: 2620:fe::fe@853
  forward-addr: 9.9.9.9@853
  forward-addr: 2620:fe::9@853
  forward-addr: 149.112.112.112@853
  # Cloudflare DNS
  forward-addr: 2606:4700:4700::1111@853
  forward-addr: 1.1.1.1@853
  forward-addr: 2606:4700:4700::1001@853
  forward-addr: 1.0.0.1@853
  # Dismail DNS
  forward-addr: 80.241.218.68
  forward-addr: 2a02:c205:3001:4558::1
  forward-addr: 159.69.114.157
  forward-addr: 2a01:4f8:c17:739a::2
User avatar
Joulinar
Posts: 3701
Joined: Sat Nov 16, 2019 12:49 am

Re: Setup Unbound with localhost as basic DNS

Post by Joulinar »

Hi,

maybe you like to wait until next DietPi release. There Unbound will become part of dietpi-software catalogue https://github.com/MichaIng/DietPi/pull/3872
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply