Dear reader,
This is the line for hosts in my nsswitch.conf:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
Both 'files' and 'mdns4_minimal' return NOTFOUND for a lookup:
root@http-lyr01:~# getent -s hosts:files hosts williamedwards.nl
root@http-lyr01:~# echo $?
2
root@http-lyr01:~# getent -s hosts:mdns4_minimal hosts
williamedwards.nl
root@http-lyr01:~# echo $?
2
Quoting the 'exit status' section in getent(1):
2 One or more supplied key could not be found in the database.
However, the 'dns' database (which comes *after* the return statement)
is also used, as my lookup succeeds with the result that the 'dns'
database returns.
Could anyone explain why that is? I would expect the lookup to fail
because of the 'NOTFOUND=return'.
--
With kind regards,
William Edwards