mailing list of musl libc
 help / color / mirror / code / Atom feed
* domain name resolution issues
@ 2014-01-23 16:53 Szabolcs Nagy
  2014-01-27  1:05 ` Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: Szabolcs Nagy @ 2014-01-23 16:53 UTC (permalink / raw)
  To: musl

getaddrinfo fails to parse /etc/hosts entries if they are
whitespace prefixed (not sure if that's legit, but glibc
can parse it)

and only the first match is returned, eg.

	getaddrinfo("localhost", 0, 0, &ai);

only gives one result (127.0.0.1) eventhough /etc/hosts says

	127.0.0.1  localhost
	::1        localhost ip6-localhost ip6-loopback

then if i do a name lookup on the returned address with

	getnameinfo(ai->ai_addr, ai->ai_addrlen, host, sizeof host, serv, sizeof serv, 0);

it seems to do a complete dns query to the nameserver,
i wonder if it might worth to do a local /etc/hosts
search first

(i see now that the test system should run in a sandboxed
environment otherwise such interfaces are not possible to
test)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-27  1:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-23 16:53 domain name resolution issues Szabolcs Nagy
2014-01-27  1:05 ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).