From cb9c6075bb2733a2b4f383fe794604ed885cdb95 Mon Sep 17 00:00:00 2001 From: minoplhy Date: Mon, 13 Sep 2021 08:59:49 +0700 Subject: [PATCH] nginx will now handle plain dns requests --- configuration/dns-resolver/kresd-forward.conf | 2 -- configuration/dns-resolver/kresd.conf | 3 --- configuration/reverseproxy/nginx/dns-stream | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 configuration/reverseproxy/nginx/dns-stream diff --git a/configuration/dns-resolver/kresd-forward.conf b/configuration/dns-resolver/kresd-forward.conf index aa06f99..d302f3f 100644 --- a/configuration/dns-resolver/kresd-forward.conf +++ b/configuration/dns-resolver/kresd-forward.conf @@ -7,8 +7,6 @@ log_level('info') -- Network interface configuration net.listen('127.0.0.1', 5353, { kind = 'dns' }) net.listen('::1', 5353, { kind = 'dns', freebind = true }) -net.listen('0.0.0.0', 53, { kind = 'dns' }) -net.listen('::', 53, { kind = 'dns', freebind = true }) -- Load useful modules diff --git a/configuration/dns-resolver/kresd.conf b/configuration/dns-resolver/kresd.conf index b625b81..37a4d2e 100644 --- a/configuration/dns-resolver/kresd.conf +++ b/configuration/dns-resolver/kresd.conf @@ -7,9 +7,6 @@ log_level('info') -- Network interface configuration net.listen('127.0.0.1', 5353, { kind = 'dns' }) net.listen('::1', 5353, { kind = 'dns', freebind = true }) -net.listen('0.0.0.0', 53, { kind = 'dns' }) -net.listen('::', 53, { kind = 'dns', freebind = true }) - -- Load useful modules modules = { diff --git a/configuration/reverseproxy/nginx/dns-stream b/configuration/reverseproxy/nginx/dns-stream new file mode 100644 index 0000000..ebaf953 --- /dev/null +++ b/configuration/reverseproxy/nginx/dns-stream @@ -0,0 +1,14 @@ +# DNS (TCP) server +server { + listen 53; + listen [::]:53; + proxy_pass dns; +} + +# DNS (UDP) server +server { + listen 53 udp; + listen [::]:53 udp; + proxy_responses 1; + proxy_pass dns; +}