This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

getent hosts exit code 2 for all names in /etc/hosts


With current Cygwin 64 getent hosts returns exit code 2 
for all names in /etc/hosts, addresses still work fine, 
while getent ahosts returns the expected results for all 
names in /etc/hosts.
In previous releases getent hosts and getent ahosts both 
returned equivalent results.

Attached cygcheck -svr output [lightly redacted].
I have other Unix like bins and Windows equivalents, 
and a load of tools in my path following Cygwin 64, 
plus its absolute patch so everything interoperates
in Windows, so cygcheck is huge.

I have straces of good and bad commands available. 

STC

uname -srvmo
getent ahosts localhost
echo $?
getent hosts localhost
echo $?
getent ahosts w10
echo $?
getent hosts w10
echo $?
getent hosts XXXxxxxxX
echo $?
getent hosts xxxxxxxxx
echo $?

[substitute your own host names for w10, xxxxxxxx, XXXxxxxxX]

output

$ uname -srvmo
CYGWIN_NT-10.0 2.7.0(0.306/5/3) 2017-02-12 13:18 x86_64 Cygwin
$ getent ahosts localhost
::1             0      XXXxxxxxX
127.0.0.1       0      
$ echo $?
0
getent hosts localhost
$ getent hosts localhost
::1             localhost
$ echo $?
0
getent ahosts w10
$ getent ahosts w10
192.168.1.100   0      XXXxxxxxX
127.0.1.1       0      
$ echo $?
0
getent hosts w10
$ getent hosts w10
$ echo $?
2
getent hosts XXXxxxxxX
$ getent hosts XXXxxxxxX
$ echo $?
2
getent hosts xxxxxxxxx
$ getent hosts xxxxxxxxx
$ echo $?
2

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

Attachment: cygcheck-svr.txt
Description: Text document

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]