aboutsummaryrefslogtreecommitdiffstats
path: root/netwatch-dns.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-11-27 13:17:17 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-11-27 18:21:47 +0100
commit81a86ee0430c0ffccfa7e8116d383341037e07da (patch)
treeba6044bf96c09beb588db1671521ce4d963baf27 /netwatch-dns.rsc
parent1cc0e3429b4017d97529a49a09e50487d9630929 (diff)
netwatch-dns: get doh host name from static dns
Diffstat (limited to 'netwatch-dns.rsc')
-rw-r--r--netwatch-dns.rsc7
1 files changed, 6 insertions, 1 deletions
diff --git a/netwatch-dns.rsc b/netwatch-dns.rsc
index 3e3e27c..c5c8ed1 100644
--- a/netwatch-dns.rsc
+++ b/netwatch-dns.rsc
@@ -64,10 +64,15 @@ $ScriptLock $0;
:foreach Host in=[ /tool/netwatch/find where comment~"\\bdoh\\b" status="up" ] do={
:local HostVal [ /tool/netwatch/get $Host ];
:local HostInfo [ $ParseKeyValueStore ($HostVal->"comment") ];
+ :local HostName [ /ip/dns/static/find where name address=($HostVal->"host") \
+ (!type or type="A" or type="AAAA") !disabled !dynamic ];
+ :if ([ :len $HostName ] > 0) do={
+ :set HostName [ /ip/dns/static/get ($HostName->0) name ];
+ }
:if ($HostInfo->"doh" = true && $HostInfo->"disabled" != true && $DohServer = "") do={
:set DohServer [ $EitherOr ($HostInfo->"doh-url") \
- ("https://" . $HostVal->"host" . "/dns-query") ];
+ ("https://" . [ $EitherOr $HostName ($HostVal->"host") ] . "/dns-query") ];
:set DohCert ($HostInfo->"doh-cert");
}
}