enable nslookup to support truncated (partial) domain name resolution
Summary
When using different versions of nslookup to request the same DNS server, it is found that the higher version of bind-utils cannot support some queries
BIND version used
server: BIND 9.11.21
client1:bind-utils-9.11.4-26.P2.el7_9.14.x86_64
client2:bind-utils-9.11.21-6.el8.x86_64
Steps to reproduce
We use bind 9.11.21 to build a dns server(192.168.137.22) and add a zone in named.rfc1912.zones:
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
// and https://tools.ietf.org/html/rfc6303
// (c)2007 R W Franks
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// Note: empty-zones-enable yes; option is default.
// If private ranges should be forwarded, add
// disable-empty-zone "."; into options
//
zone "localhost.localdomain" IN {
type master;
file "named.localhost";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "named.localhost";
allow-update { none; };
};
zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
type master;
file "named.loopback";
allow-update { none; };
};
zone "1.0.0.127.in-addr.arpa" IN {
type master;
file "named.loopback";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.empty";
allow-update { none; };
};
zone "abc" IN {
type master;
file "abc.zone";
allow-update { none; };
};
we add abc.zone in /var/named/abc.zone
$TTL 1D
@ IN SOA dns.abc. root.dns.abc. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
abc. IN NS dns.abc.
dns.abc. IN A 192.168.137.22
mysql.print IN A 192.168.137.22
mysql-print IN A 192.168.137.22
mysql IN A 192.168.137.22
On the client side, we point to our configured dns server(192.168.137.22):
/etc/resolv.conf
# Generated by NetworkManager
search abc
nameserver 192.168.137.22
when we export in client1:
nslookup mysql.print
Server: 192.168.137.22
Address: 192.168.137.22#53
Name: mysql.print.abc
Address: 192.168.137.22
nslookup mysql.print.abc
Server: 192.168.137.22
Address: 192.168.137.22#53
Name: mysql.print.abc
Address: 192.168.137.22
when we export in client2:
nslookup mysql.print
Server: 192.168.137.22
Address: 192.168.137.22#53
** server can't find mysql.print: NXDOMAIN
nslookup mysql.print.abc
Server: 192.168.137.22
Address: 192.168.137.22#53
Name: mysql.print.abc
Address: 192.168.137.22
What is the current bug behavior?
Requesting the same DNS server, a higher version of nslookup cannot perform partial resolution successfully.
IN bind-utils 9.11.21 version, export nslookup mysql.print
return: ** server can't find mysql.print: NXDOMAIN
IN bind-utils 9.11.4 version, export nslookup mysql.print
return: successfully
What is the expected correct behavior?
IN bind-utils 9.11.21 version, export nslookup mysql.print
return: successfully
Relevant configuration files
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
secroots-file "/var/named/data/named.secroots";
recursing-file "/var/named/data/named.recursing";
allow-query { any; };
/*
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable
recursion.
- If your recursive DNS server has a public IP address, you MUST enable access
control to limit queries to your legitimate users. Failing to do so will
cause your server to become part of large scale DNS amplification
attacks. Implementing BCP38 within your network would greatly
reduce such attack surface
*/
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
/* https://fedoraproject.org/wiki/Changes/CryptoPolicy */
include "/etc/crypto-policies/back-ends/bind.config";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";