inet/resolv: Try search domains first for unqualified names
inet/resolv: Try search domains first for unqualified names

When resolving an unqualified host name, the resolver tries the original
name first before appending the domains from the search list. If a TLD
with the same name exists, the query will succeed (but yield no A record)
and the resolver will return HOST_NOT_FOUND without trying the search
domains.

This patch changes the lookup order for unqualified host names (without
dots) to try the search domains first and the original name last.

Signed-off-by: Ingo van Lil <05e5144828ea89bc51d41fe38784d4b3587b1af4@gmx.de>

brgl/uclibc-ng,foss-for-synopsys-dwc-arc-processors/uClibc,wbx-github/uclibc-ng,foss-for-synopsys-dwc-arc-processors/uClibc,wbx-github/uclibc-ng,kraj/uclibc-ng,kraj/uclibc-ng,foss-for-synopsys-dwc-arc-processors/uClibc,brgl/uclibc-ng,foss-for-synopsys-dwc-arc-processors/uClibc,wbx-github/uclibc-ng,brgl/uclibc-ng,brgl/uclibc-ng,kraj/uclibc-ng,wbx-github/uclibc-ng,kraj/uclibc-ng