From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11139 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Queries with less than `ndots` dots never lead to resolution using the global namespace if the `search` domains don't work Date: Wed, 15 Mar 2017 11:11:03 -0400 Message-ID: <20170315151103.GF1693@brightrain.aerifal.cx> References: <075030ca6fc64b13be5651fe32c5e770@CHBARSRV1EXCHP1.ANYACCESS.NET> <20170315122515.GD1693@brightrain.aerifal.cx> <0779b092406345a4b4d68ce279f97c16@CHBARSRV1EXCHP1.ANYACCESS.NET> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="+QahgC5+KEYLbs62" X-Trace: blaine.gmane.org 1489590684 9015 195.159.176.226 (15 Mar 2017 15:11:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 15 Mar 2017 15:11:24 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-11154-gllmg-musl=m.gmane.org@lists.openwall.com Wed Mar 15 16:11:19 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1coAZz-0000wz-8C for gllmg-musl@m.gmane.org; Wed, 15 Mar 2017 16:11:11 +0100 Original-Received: (qmail 30496 invoked by uid 550); 15 Mar 2017 15:11:15 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 30475 invoked from network); 15 Mar 2017 15:11:15 -0000 Content-Disposition: inline In-Reply-To: <0779b092406345a4b4d68ce279f97c16@CHBARSRV1EXCHP1.ANYACCESS.NET> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:11139 Archived-At: --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Mar 15, 2017 at 12:58:02PM +0000, dominic.chambers@glencore.com wrote: > HI Rich, > > Thanks for the prompt response here. Apologies for any confusion I > may have created, but I think the server is responding with an > overall `NXDOMAIN` response. This is what I get from running `dig > google.com.default.svc.cluster.local`: > > ``` > ; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.com.default.svc.cluster.local > ;; global options: +cmd > ;; Got answer: > ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 20863 > ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 > > ;; QUESTION SECTION: > ;google.com.default.svc.cluster.local. IN A > > ;; AUTHORITY SECTION: > cluster.local. 60 IN SOA ns.dns.cluster.local. hostmaster > .cluster.local. 1489579200 28800 7200 604800 60 > > ;; Query time: 0 msec > ;; SERVER: 10.43.0.10#53(10.43.0.10) > ;; WHEN: Wed Mar 15 12:49:14 UTC 2017 > ;; MSG SIZE rcvd: 147 > ``` > > Although there's less information with nslookup, the response from > running `nslookup google.com.default.svc.cluster.local` seems even > more definitive: > > ``` > Server: 10.43.0.10 > Address: 10.43.0.10#53 > > ** server can't find google.com.default.svc.cluster.local: NXDOMAIN > ``` > > Maybe I was just reading too much into the output from dig regarding > exactly what was being returned from the server. Any further > thoughts? Can you send an strace log of an affected lookup with musl's resolver (rather than dig/nslookup which use bind's resolver) for me to look at? Attached is source for a trivial sample utility to perform a lookup. Rich --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="gai3a.c" #include #include #include int main(int argc, char **argv) { int r; char buf[256], buf2[32]; struct addrinfo *ai, hints = { .ai_protocol = IPPROTO_TCP, .ai_flags = 0, .ai_family = AF_UNSPEC }; char *name = argc>1 ? argv[1][0] ? argv[1] : 0 : 0; char *serv = argc>2 ? argv[2] : 0; r = getaddrinfo(name, serv, &hints, &ai); if (r<0) printf("%s: %s\n", name, gai_strerror(r)); else for (; ai; ai = ai->ai_next) if (!getnameinfo(ai->ai_addr, ai->ai_addrlen, buf, sizeof buf, buf2, sizeof buf2, NI_NUMERICHOST|NI_NUMERICSERV)) printf("%s: %s %s %s %s %s\n", name?name:"NULL", ai->ai_canonname, buf, buf2, ai->ai_protocol == IPPROTO_TCP ? "tcp" : "udp", ai->ai_socktype == SOCK_STREAM ? "stream" : "dgram"); return 0; } --+QahgC5+KEYLbs62--