From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4515 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: domain name resolution issues Date: Thu, 23 Jan 2014 17:53:56 +0100 Message-ID: <20140123165356.GN1685@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1390496041 13644 80.91.229.3 (23 Jan 2014 16:54:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jan 2014 16:54:01 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4519-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jan 23 17:54:09 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1W6NXc-0001Ro-SZ for gllmg-musl@plane.gmane.org; Thu, 23 Jan 2014 17:54:09 +0100 Original-Received: (qmail 13593 invoked by uid 550); 23 Jan 2014 16:54:08 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 13585 invoked from network); 23 Jan 2014 16:54:08 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:4515 Archived-At: 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)