[question] strange dig with IDN
Summary
dig output to terminal is different from output to file/pipe for idn queries
BIND version used
(Paste the output of named -V
.)
BIND 9.18.7 (Stable Release) id:85a6eb1
running on Darwin x86_64 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64
built by make with '--prefix=/opt/local' '--disable-silent-rules' '--mandir=/opt/local/share/man' '--with-openssl=/opt/local' '--with-libidn2=/opt/local' '--enable-doh' 'CC=/usr/bin/clang' 'CFLAGS=-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64' 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64' 'CPPFLAGS=-I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk'
compiled by CLANG Apple LLVM 14.0.0 (clang-1400.0.29.102)
compiled with OpenSSL version: OpenSSL 3.0.5 5 Jul 2022
linked to OpenSSL version: OpenSSL 3.0.5 5 Jul 2022
compiled with libuv version: 1.44.2
linked to libuv version: 1.44.2
compiled with libnghttp2 version: 1.50.0
linked to libnghttp2 version: 1.50.0
compiled with libxml2 version: 2.10.2
linked to libxml2 version: 21002
compiled with json-c version: 0.16
linked to json-c version: 0.16
compiled with zlib version: 1.2.12
linked to zlib version: 1.2.12
threads support is enabled
default paths: named configuration: /opt/local/etc/named.conf rndc configuration: /opt/local/etc/rndc.conf DNSSEC root key: /opt/local/etc/bind.keys nsupdate session key: /opt/local/var/run/named/session.key named PID file: /opt/local/var/run/named/named.pid named lock file: /opt/local/var/run/named/named.lock
dig -v
DiG 9.18.7
Steps to reproduce
export LANG=uk_UA.UTF-8 export LANGUAGE=uk_UA.UTF-8
echo укр. > /tmp/f
dig ns -f /tmp/f dig ns -f /tmp/f | cat
Queried domain from file to be sure that shell don't damage args
Checked at FreeBSD 13.1, macOS 12.6, Ubuntu 22.04, Debian 11.5
(How one can reproduce the issue - this is very important.)
What is the current bug behavior?
different queries to resolver
tcpdump from "dig ns -f /tmp/f": 14:37:03.156768 IP 10.11.14.5.53545 > 10.11.12.1.53: 63892+ [1au] NS? xn--j1amh. (50) 14:37:03.158987 IP 10.11.12.1.53 > 10.11.14.5.53545: 63892 6/0/1 NS dns2.u-registry.net., NS ukr.ns.ua., NS tier1.num.net.ua., NS dns.tci.net.ua., NS dns1.u-registry.com., NS dns3.dotukr.com. (242)
tcpdumo from "dig ns -f /tmp/f | cat" 14:37:09.436218 IP 10.11.14.5.56868 > 10.11.12.1.53: 49469+ [1au] NS? M-QM-^CM-PM-:M-QM-^@. (47) 14:37:09.445445 IP 10.11.12.1.53 > 10.11.14.5.56868: 49469 NXDomain* 0/1/1 (138)
Queried domain from file to be sure that shell don't damage args
Checked at FreeBSD 13.1, macOS 12.6, Ubuntu 22.04, Debian 11.5
(What actually happens.)
What is the expected correct behavior?
Expected the same output from "dig ns укр." and from "dig ns укр. | cat"
(What you should see instead.)
Relevant configuration files
(Paste any relevant configuration files - please use code blocks (```)
to format console output. If submitting the contents of your
configuration file in a non-confidential Issue, it is advisable to
obscure key secrets: this can be done automatically by using
named-checkconf -px
.)
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code, as it's very hard to read otherwise.)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem.)