$ host loopy.loo.found.not; print $?
Host loopy.loo.found.not not found: 3(NXDOMAIN)
1

$ host loopy.loo.found.not > /dev/null; print $?
1

$ host loopy.loo.found.not 2>/dev/null; print $?
Host loopy.loo.found.not not found: 3(NXDOMAIN)
1


There's a printf at line 429 of /usr/src/usr.sbin/bind/bin/dig/host.c

Line 569's printf may also be going to STDOUT. Maybe others....


Successful output to STDOUT:

$ host www.example.org; print $?
www.example.org has address 93.184.216.119
www.example.org has IPv6 address 2606:2800:220:6d:26bf:1447:1097:aa7
0

$ host www.example.org >/dev/null; print $?
0

Reply via email to