From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: domain name resolution issues
Date: Thu, 23 Jan 2014 17:53:56 +0100 [thread overview]
Message-ID: <20140123165356.GN1685@port70.net> (raw)
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)
next reply other threads:[~2014-01-23 16:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-23 16:53 Szabolcs Nagy [this message]
2014-01-27 1:05 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140123165356.GN1685@port70.net \
--to=nsz@port70.net \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).