khost ignores "search" in /etc/resolv.conf
I assume I see a bug in khost
, like it ignores search directive in /etc/resolv.conf
$ khost --version
khost (Knot DNS), version 2.7.8
$ tail -4 /etc/resolv.conf
nameserver 127.0.0.53
options edns0 trust-ad
search home
I run local DNS/DHCP server for LAN and I use "private" domain "home". Local DNS server is at 192.168.222.1. Test with host
, it works:
$ host -V
host 9.16.1-Ubuntu
$ host android-tablet2 192.168.222.1
Using domain server:
Name: 192.168.222.1
Address: 192.168.222.1#53
Aliases:
android-tablet2.home is an alias for android-broken.home.
Host android-broken.home not found: 3(NXDOMAIN)
Host android-broken.home not found: 3(NXDOMAIN)
$ host android-tablet2.home 192.168.222.1
Using domain server:
Name: 192.168.222.1
Address: 192.168.222.1#53
Aliases:
android-tablet2.home is an alias for android-broken.home.
Host android-broken.home not found: 3(NXDOMAIN)
Host android-broken.home not found: 3(NXDOMAIN)
khost
fails when I do not specify domain:
$ khost android-tablet2.home 192.168.222.1
android-tablet2.home. is an alias for android-broken.home.
$ khost android-tablet2 192.168.222.1
Host android-tablet2. type A error: NXDOMAIN
Host android-tablet2. type AAAA error: NXDOMAIN
Host android-tablet2. type MX error: NXDOMAIN
Evidence that /etc/resolv.conf
is ignored by khost
:
$ strace host android-tablet2 192.168.222.1 2>&1 | grep etc
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/etc/resolv.conf", O_RDONLY) = 6
$ strace khost android-tablet2 192.168.222.1 2>&1 | grep etc
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
stat("/etc/gnutls/config", 0x7ffce4583150) = -1 ENOENT (No such file or directory)