Compdigitec Labs

« | Home | »

Simple recursive DNS server with Unbound DNS

By admin | July 30, 2020

This is a simple configuration for running a recursive DNS server (passes DNS requests to another server and caches responses) with the Unbound DNS server.

Installation (Ubuntu):

sudo apt-get install -y unbound

Open the config

sudo vim /etc/unbound/unbound.conf

Configuration

Replace 8.8.8.8 below with the desired upstream DNS server.

# The following line includes additional configuration files from the
# /etc/unbound/unbound.conf.d directory.
#include: "/etc/unbound/unbound.conf.d/*.conf"
# NOTE: needed to comment out the above line avoid a "status: SERVFAIL" response

server:
    # Enable verbose debugging messages
    verbosity: 1000

    # Run on all interfaces
    interface: 0.0.0.0

    # Hide the server name and version
    hide-identity: yes
    hide-version: yes

    # Who should be able to query the server
    access-control: 0.0.0.0/0 allow

    do-ip4: yes
    do-ip6: no

    do-udp: yes
    # Enable this to support TCP DNS which is required in some applications
    do-tcp: yes

    # Allow forwarding to another 127.0.0.0/8 DNS server (e.g. another local dnsmasq or systemd-resolve)
    do-not-query-localhost: no

forward-zone:
    name: "."
    # Replace 8.8.8.8 with your desired upstream DNS server
    # You can have multiple forward-addr lines
    forward-addr: 8.8.8.8@53

Starting the server

sudo systemctl restart unbound

Debugging / Troubleshooting

Query the server

dig @your_server_here example.com

Read the DNS server log

sudo systemctl status unbound -n 50

References:

If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!

Topics: Linux | 10 Comments »

10 Responses to “Simple recursive DNS server with Unbound DNS”

  1. ไก่ตัน Says:
    November 2nd, 2024 at 22:26

    … [Trackback]

    […] Read More here to that Topic: compdigitec.com/labs/2020/07/30/simple-recursive-dns-server-with-unbound-dns/ […]

  2. PG SLOT จ่ายจริง ตัวคูณโหด Says:
    November 7th, 2024 at 23:39

    … [Trackback]

    […] There you can find 56820 more Information on that Topic: compdigitec.com/labs/2020/07/30/simple-recursive-dns-server-with-unbound-dns/ […]

  3. zbet911 Says:
    November 12th, 2024 at 18:41

    … [Trackback]

    […] Read More on that Topic: compdigitec.com/labs/2020/07/30/simple-recursive-dns-server-with-unbound-dns/ […]

  4. สมัครเว็บบอล เว็บตรงไม่ผ่านเอเย่นต์ Says:
    November 15th, 2024 at 22:39

    … [Trackback]

    […] There you can find 71179 additional Info on that Topic: compdigitec.com/labs/2020/07/30/simple-recursive-dns-server-with-unbound-dns/ […]

  5. เว็บตรงสล็อต Says:
    November 15th, 2024 at 23:58

    … [Trackback]

    […] Info on that Topic: compdigitec.com/labs/2020/07/30/simple-recursive-dns-server-with-unbound-dns/ […]

  6. gubet Says:
    November 22nd, 2024 at 06:12

    … [Trackback]

    […] Find More on that Topic: compdigitec.com/labs/2020/07/30/simple-recursive-dns-server-with-unbound-dns/ […]

  7. car detailing Says:
    November 23rd, 2024 at 06:30

    … [Trackback]

    […] Read More Info here on that Topic: compdigitec.com/labs/2020/07/30/simple-recursive-dns-server-with-unbound-dns/ […]

  8. โป๊กเกอร์ Says:
    November 27th, 2024 at 23:26

    … [Trackback]

    […] Find More on that Topic: compdigitec.com/labs/2020/07/30/simple-recursive-dns-server-with-unbound-dns/ […]

  9. รถบรรทุกอีซูซุ Says:
    December 10th, 2024 at 20:56

    … [Trackback]

    […] Here you will find 46676 additional Info on that Topic: compdigitec.com/labs/2020/07/30/simple-recursive-dns-server-with-unbound-dns/ […]

  10. เช่ารถตู้พร้อมคนขับ Says:
    December 11th, 2024 at 20:55

    … [Trackback]

    […] Here you will find 99830 additional Info on that Topic: compdigitec.com/labs/2020/07/30/simple-recursive-dns-server-with-unbound-dns/ […]

Comments