| Summary: | host name lookup quirk | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Thomas Koeller <thomas> | ||||
| Component: | ssh | Assignee: | Assigned to nobody <unassigned-bugs> | ||||
| Status: | CLOSED INVALID | ||||||
| Severity: | normal | CC: | djm | ||||
| Priority: | P5 | ||||||
| Version: | 9.1p1 | ||||||
| Hardware: | Other | ||||||
| OS: | Linux | ||||||
| Attachments: |
|
||||||
|
Description
Thomas Koeller
2022-12-13 00:47:11 AEDT
That is not documented behaviour of NI_NAMERQD:
> NI_NAMEREQD
> If set, then an error is returned if the hostname
> cannot be determined.
Do you have the short names in question in /etc/hosts? If so, they may be used in favour of a full DNS lookup.
(In reply to Damien Miller from comment #1) > That is not documented behaviour of NI_NAMERQD: Of course not, but it is the actual behavior I observe. I put a debug output statement right after the call to getnameinfo() in in canohost.c: /* Get the address in ascii. */ if ((r = getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop), NULL, 0, flags)) != 0) { error_f("getnameinfo %d failed: %s", flags, ssh_gai_strerror(r)); return NULL; } >>> debug_f("host name lookup returned: %s", ntop); return xstrdup(ntop); and this is what I get: [thomas@sarkovy ~]$ ssh -6 -v sarkovy.koeller.dyndns.org 2>&1 | grep -e '^debug1: get_socket_address:' debug1: get_socket_address: host name lookup returned: fd46:1ffa:d8e0::1 (flags = 1) debug1: get_socket_address: host name lookup returned: fd46:1ffa:d8e0::1 (flags = 1) debug1: get_socket_address: host name lookup returned: sarkovy.koeller.dyndns.org (flags = 8) debug1: get_socket_address: host name lookup returned: fd46:1ffa:d8e0::1 (flags = 1) [thomas@sarkovy ~]$ ssh -4 -v sarkovy.koeller.dyndns.org 2>&1 | grep -e '^debug1: get_socket_address:' debug1: get_socket_address: host name lookup returned: 192.168.0.1 (flags = 1) debug1: get_socket_address: host name lookup returned: 192.168.0.1 (flags = 1) debug1: get_socket_address: host name lookup returned: sarkovy (flags = 8) > Do you have the short names in question in /etc/hosts? If so, they > may be used in favour of a full DNS lookup. No, I don't, the names are looked up via DNS. Created attachment 3642 [details]
debug patch
A patch to add debug output showing the problem.
nsswitch configuration was at fault. could you elaborate, in case someone else has the same problem? OpenSSH 9.3 has been released. Close resolved bugs |