FS#52133 - [systemd] /etc/nsswitch.conf suggested by systemd throws "hostname: gethostbyname: Unknown host"
Attached to Project:
Arch Linux
Opened by Serhat Cevikel (serhatcevikel) - Monday, 12 December 2016, 22:37 GMT
Last edited by Doug Newgard (Scimmia) - Tuesday, 13 December 2016, 17:29 GMT
Opened by Serhat Cevikel (serhatcevikel) - Monday, 12 December 2016, 22:37 GMT
Last edited by Doug Newgard (Scimmia) - Tuesday, 13 December 2016, 17:29 GMT
|
Details
Description:
Latest update to systemd package on 2016-12-09 19:34 UTC changed the /etc/nsswitch.conf file as per the feature request 51709 (https://bugs.archlinux.org/task/51709) as follows (left previous, right latest): passwd: files | passwd: compat mymachines systemd group: files | group: compat mymachines systemd shadow: files | shadow: compat hosts: files dns myhostname | hosts: files mymachines resolve [!UNAVAIL=return] dns myhostname However, the command "hostname -i" throws: "hostname: gethostbyname: Unknown host" and the error is resolved only by restoring the "hosts: *" line (however the "systemd" version of the config file is changed then). strace output shows following "open" calls: open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 open("/etc/resolv.conf", O_RDONLY|O_CLOEXEC) = 3 open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3 open("/usr/lib/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 3 open("/etc/host.conf", O_RDONLY|O_CLOEXEC) = 3 open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 3 open("/usr/lib/libnss_mymachines.so.2", O_RDONLY|O_CLOEXEC) = 3 open("/usr/lib/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3 open("/usr/lib/libcap.so.2", O_RDONLY|O_CLOEXEC) = 3 open("/usr/lib/librt.so.1", O_RDONLY|O_CLOEXEC) = 3 open("/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3 open("/usr/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3 open("/usr/lib/libnss_resolve.so.2", O_RDONLY|O_CLOEXEC) = 3 open("/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3 open("/usr/lib/libnss_dns.so.2", O_RDONLY|O_CLOEXEC) = 4 Additional info: * package version(s): 232-6 * config and/or log files etc. : /etc/nsswitch.conf Steps to reproduce: hostname -i |
This task depends upon
Closed by Doug Newgard (Scimmia)
Tuesday, 13 December 2016, 17:29 GMT
Reason for closing: None
Additional comments about closing: See FS#51709
Tuesday, 13 December 2016, 17:29 GMT
Reason for closing: None
Additional comments about closing: See
Seems like this only fails when systemd-resolved is not running.