{"id":407,"date":"2020-07-30T23:27:22","date_gmt":"2020-07-31T03:27:22","guid":{"rendered":"http:\/\/www.compdigitec.com\/labs\/?p=407"},"modified":"2020-07-30T23:27:22","modified_gmt":"2020-07-31T03:27:22","slug":"simple-recursive-dns-server-with-unbound-dns","status":"publish","type":"post","link":"http:\/\/www.compdigitec.com\/labs\/2020\/07\/30\/simple-recursive-dns-server-with-unbound-dns\/","title":{"rendered":"Simple recursive DNS server with Unbound DNS"},"content":{"rendered":"<p>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.<\/p>\n<p><b>Installation (Ubuntu):<\/b><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo apt-get install -y unbound\n<\/pre>\n<p><b>Open the config<\/b><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo vim \/etc\/unbound\/unbound.conf\n<\/pre>\n<p><b>Configuration<\/b><\/p>\n<p>Replace 8.8.8.8 below with the desired upstream DNS server.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# The following line includes additional configuration files from the\n# \/etc\/unbound\/unbound.conf.d directory.\n#include: &quot;\/etc\/unbound\/unbound.conf.d\/*.conf&quot;\n# NOTE: needed to comment out the above line avoid a &quot;status: SERVFAIL&quot; response\n\nserver:\n    # Enable verbose debugging messages\n    verbosity: 1000\n\n    # Run on all interfaces\n    interface: 0.0.0.0\n\n    # Hide the server name and version\n    hide-identity: yes\n    hide-version: yes\n\n    # Who should be able to query the server\n    access-control: 0.0.0.0\/0 allow\n\n    do-ip4: yes\n    do-ip6: no\n\n    do-udp: yes\n    # Enable this to support TCP DNS which is required in some applications\n    do-tcp: yes\n\n    # Allow forwarding to another 127.0.0.0\/8 DNS server (e.g. another local dnsmasq or systemd-resolve)\n    do-not-query-localhost: no\n\nforward-zone:\n    name: &quot;.&quot;\n    # Replace 8.8.8.8 with your desired upstream DNS server\n    # You can have multiple forward-addr lines\n    forward-addr: 8.8.8.8@53\n<\/pre>\n<p><b>Starting the server<\/b><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo systemctl restart unbound<\/pre>\n<p><b>Debugging \/ Troubleshooting<\/b><\/p>\n<p>Query the server<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">dig @your_server_here example.com<\/pre>\n<p>Read the DNS server log<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">sudo systemctl status unbound -n 50<\/pre>\n<p>References:<\/p>\n<ul>\n<li><a href=\"https:\/\/calomel.org\/unbound_dns.html\" target=\"_blank\" rel=\"noopener noreferrer\">Unbound DNS Server Tutorial @ Calomel.org<\/a><\/li>\n<li><a href=\"https:\/\/wiki.archlinux.org\/index.php\/unbound#Forward_all_remaining_requests\" target=\"_blank\" rel=\"noopener noreferrer\">unbound &#8211; Arch Linux Wiki<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>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): Open the config Configuration Replace 8.8.8.8 below with the desired upstream DNS server. Starting the server Debugging \/ Troubleshooting Query the server Read the DNS server log References: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[870,862,871,28,869],"_links":{"self":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/407"}],"collection":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/comments?post=407"}],"version-history":[{"count":0,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/407\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/media?parent=407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/categories?post=407"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/tags?post=407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}