Hello,

I discovered a potential problem in getaddrinfo/__lookup_name.
When calling getaddrinfo  with an IP string not matching the specified family,
name_from_numeric() in __lookup_name() will not recognize it and the 
external dns resolver will be used.

So the following code:

const struct addrinfo hints = {
    .ai_flags = AI_ADDRCONFIG,
    .ai_family = AF_INET,
    .ai_socktype = SOCK_STREAM,
};

getaddrinfo("::1", NULL, &hints, &result);

will actually succeed instead of returning EAI_NONAME,
and perform a "A ::1" query.
Some misbehaving dns servers will then answer with 0.0.0.1.

I don’t know if this behavior is desirable. If not, I’m still not sure
where this should be fixed. Maybe should we prevent sending
A and AAAA dns queries with IP as hostname in __res_mkquery() ?

Julien