mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
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	[thread overview]
Message-ID: <20170315151103.GF1693@brightrain.aerifal.cx> (raw)
In-Reply-To: <0779b092406345a4b4d68ce279f97c16@CHBARSRV1EXCHP1.ANYACCESS.NET>

[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]

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

[-- Attachment #2: gai3a.c --]
[-- Type: text/plain, Size: 785 bytes --]

#include <stdio.h>
#include <netdb.h>
#include <netinet/in.h>

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;
}

  reply	other threads:[~2017-03-15 15:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15 10:28 dominic.chambers
2017-03-15 12:25 ` Rich Felker
2017-03-15 12:58   ` dominic.chambers
2017-03-15 15:11     ` Rich Felker [this message]
2017-03-15 16:58       ` dominic.chambers
2017-03-15 17:10       ` dominic.chambers
2017-03-15 17:22         ` Rich Felker
2017-03-15 19:26           ` dominic.chambers

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=20170315151103.GF1693@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --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).