From 462dbc2dea99c048dc4992191f6e3510e0b0df53 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 11 Aug 2022 08:53:11 +0200 Subject: [PATCH] Try to fix DNS issue --- omr-6in4/files/etc/init.d/omr-6in4 | 4 +-- .../files/etc/uci-defaults/1940-omr-dns | 25 +++++++++++++------ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/omr-6in4/files/etc/init.d/omr-6in4 b/omr-6in4/files/etc/init.d/omr-6in4 index e29103a3d..533c06f17 100755 --- a/omr-6in4/files/etc/init.d/omr-6in4 +++ b/omr-6in4/files/etc/init.d/omr-6in4 @@ -32,7 +32,7 @@ set_ipv6_state() { if [ "$disable_ipv6" = "1" ]; then logger -t "omr-6in4" "Disable IPv6" uci -q batch <<-EOF >/dev/null - set unbound.ub_main.protocol='ip4_only' + set unbound.@unbound[-1].protocol='ip4_only' commit unbound del_list v2ray.main.inbounds="omr6" commit v2ray @@ -50,7 +50,7 @@ set_ipv6_state() { set network.omr6in4.force_link=1 set network.omr6in4.metric=1 delete network.omr6in4.auto - set unbound.ub_main.protocol='mixed' + set unbound.@unbound[-1].protocol='mixed' commit unbound EOF if [ "$(uci -q get network.globals.ula_prefix)" = "" ]; then diff --git a/openmptcprouter/files/etc/uci-defaults/1940-omr-dns b/openmptcprouter/files/etc/uci-defaults/1940-omr-dns index d9986be6d..6bf0e79e7 100755 --- a/openmptcprouter/files/etc/uci-defaults/1940-omr-dns +++ b/openmptcprouter/files/etc/uci-defaults/1940-omr-dns @@ -1,6 +1,6 @@ #!/bin/sh -if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then - if [ "$(uci -q get unbound.@unbound[0].listen_port | grep 5353)" = "" ]; then +if [ "$(uci -q get openmptcprouter.settings.version)" = "" ]; then + if [ "$(uci -q get unbound.@unbound[-1].listen_port | grep 5353)" = "" ]; then uci -q batch <<-EOF >/dev/null set unbound.@unbound[-1].listen_port=5353 set unbound.@unbound[-1].protocol="ip4_only" @@ -8,11 +8,11 @@ if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then set unbound.@unbound[-1].recursion="aggressive" set unbound.@unbound[-1].validator='1' set unbound.@unbound[-1].validator_ntp='1' - del unbound.ub_main.dns64_prefix - del unbound.ub_main.iface_wan - del unbound.ub_main.dhcp4_slaac6 - del unbound.ub_main.query_minimize - del unbound.ub_main.query_min_strict + del unbound.@unbound[-1].dns64_prefix + del unbound.@unbound[-1].iface_wan + del unbound.@unbound[-1].dhcp4_slaac6 + del unbound.@unbound[-1].query_minimize + del unbound.@unbound[-1].query_min_strict commit unbound EOF fi @@ -24,6 +24,13 @@ if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then EOF fi fi +if [ -z "$(uci -q get unbound.ub_main)" ]; then + uci -q batch <<-EOF >/dev/null + rename unbound.@unbound[-1]=ub_main + commit unbound + EOF + +fi if [ "$(uci -q show dhcp | grep 'use-application-dns.net')" = "" ]; then uci -q batch <<-EOF >/dev/null add_list dhcp.@dnsmasq[-1].server="/use-application-dns.net/" @@ -66,6 +73,7 @@ fi if [ -z "$(uci -q show unbound.auth_icann)" ]; then uci -q batch <<-EOF >/dev/null + del unbound.auth_icann set unbound.auth_icann=zone set unbound.auth_icann.fallback='1' set unbound.auth_icann.url_dir='https://www.internic.net/domain/' @@ -77,6 +85,7 @@ if [ -z "$(uci -q show unbound.auth_icann)" ]; then add_list unbound.auth_icann.zone_name='in-addr.arpa.' add_list unbound.auth_icann.zone_name='ip6.arpa.' set unbound.auth_icann.enabled='1' + del unbound.fwd_isp set unbound.fwd_isp=zone set unbound.fwd_isp.enabled='0' set unbound.fwd_isp.fallback='1' @@ -84,6 +93,7 @@ if [ -z "$(uci -q show unbound.auth_icann)" ]; then set unbound.fwd_isp.zone_type='forward_zone' add_list unbound.fwd_isp.zone_name='isp-bill.example.com.' add_list unbound.fwd_isp.zone_name='isp-mail.example.net.' + del unbound.fwd_google set unbound.fwd_google=zone set unbound.fwd_google.enabled='0' set unbound.fwd_google.fallback='1' @@ -95,6 +105,7 @@ if [ -z "$(uci -q show unbound.auth_icann)" ]; then add_list unbound.fwd_google.server='2001:4860:4860::8844' add_list unbound.fwd_google.server='2001:4860:4860::8888' set unbound.fwd_google.zone_name='.' + del unbound.fwd_cloudflare set unbound.fwd_cloudflare=zone set unbound.fwd_cloudflare.enabled='0' set unbound.fwd_cloudflare.fallback='1'