mailing list of musl libc
 help / color / mirror / code / Atom feed
From: <dominic.chambers@glencore.com>
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 17:10:08 +0000	[thread overview]
Message-ID: <1e14e4e5bddc41518ff651e4b841c2b1@CHBARSRV1EXCHP1.ANYACCESS.NET> (raw)
In-Reply-To: <20170315151103.GF1693@brightrain.aerifal.cx>

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

HI Rich,

I've attached the results from running the following two commands:

  1. ` strace ./gai3a google.com 2> strace_of_google-com.txt`
  2. ` strace ./gai3a google.com.default.svc 2> strace_of_google-com-default-svc.txt`

Is this what you were looking for or can I provide something more useful?

Thanks again, Dominic.

-----Original Message-----
From: Rich Felker [mailto:dalias@aerifal.cx] On Behalf Of Rich Felker
Sent: 15 March 2017 16:11
To: musl@lists.openwall.com
Subject: Re: [musl] Queries with less than `ndots` dots never lead to resolution using the global namespace if the `search` domains don't work

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
LEGAL DISCLAIMER. The contents of this electronic communication
and any attached documents are strictly confidential and they may not
be used or disclosed by someone who is not a named recipient.
If you have received this electronic communication in error please notify
the sender by replying to this electronic communication inserting the
word "misdirected" as the subject and delete this communication from
your system.

[-- Attachment #2: strace_of_google-com.txt --]
[-- Type: text/plain, Size: 5095 bytes --]

execve("./gai3a", ["./gai3a", "google.com"], [/* 15 vars */]) = 0
arch_prctl(ARCH_SET_FS, 0x7f98bb5b2b48) = 0
set_tid_address(0x7f98bb5b2b80)         = 44
mprotect(0x7f98bb5af000, 4096, PROT_READ) = 0
mprotect(0x5591835ef000, 4096, PROT_READ) = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC)  = 3
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
readv(3, [{iov_base="", iov_len=0}, {iov_base="# Kubernetes-managed hosts file."..., iov_len=1024}], 2) = 202
readv(3, [{iov_base="", iov_len=0}, {iov_base="", iov_len=1024}], 2) = 0
close(3)                                = 0
open("/etc/resolv.conf", O_RDONLY|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
readv(3, [{iov_base="", iov_len=0}, {iov_base="search default.svc.cluster.local"..., iov_len=248}], 2) = 218
readv(3, [{iov_base="", iov_len=0}, {iov_base="", iov_len=248}], 2) = 0
close(3)                                = 0
socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
sendto(3, "\271\377\1\0\0\1\0\0\0\0\0\0\6google\3com\7default\3"..., 54, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 54
sendto(3, "\341\262\1\0\0\1\0\0\0\0\0\0\6google\3com\7default\3"..., 54, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 54
poll([{fd=3, events=POLLIN}], 1, 2500)  = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "\271\377\201\203\0\1\0\0\0\1\0\0\6google\3com\7default\3"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 147
recvfrom(3, "\341\262\201\203\0\1\0\0\0\1\0\0\6google\3com\7default\3"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 147
close(3)                                = 0
socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
sendto(3, "\376\300\1\0\0\1\0\0\0\0\0\0\6google\3com\3svc\7clus"..., 46, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 46
sendto(3, "\2.\1\0\0\1\0\0\0\0\0\0\6google\3com\3svc\7clus"..., 46, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 46
poll([{fd=3, events=POLLIN}], 1, 2500)  = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "\376\300\201\203\0\1\0\0\0\1\0\0\6google\3com\3svc\7clus"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 139
recvfrom(3, "\2.\201\203\0\1\0\0\0\1\0\0\6google\3com\3svc\7clus"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 139
close(3)                                = 0
socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
sendto(3, "\7\340\1\0\0\1\0\0\0\0\0\0\6google\3com\7cluster\5"..., 42, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 42
sendto(3, "\n\346\1\0\0\1\0\0\0\0\0\0\6google\3com\7cluster\5"..., 42, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 42
poll([{fd=3, events=POLLIN}], 1, 2500)  = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "\7\340\201\203\0\1\0\0\0\1\0\0\6google\3com\7cluster\5"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 135
recvfrom(3, "\n\346\201\203\0\1\0\0\0\1\0\0\6google\3com\7cluster\5"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 135
close(3)                                = 0
socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
sendto(3, "H\244\1\0\0\1\0\0\0\0\0\0\6google\3com\7kubelet\n"..., 64, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 64
sendto(3, "K\266\1\0\0\1\0\0\0\0\0\0\6google\3com\7kubelet\n"..., 64, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 64
poll([{fd=3, events=POLLIN}], 1, 2500)  = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "H\244\205\200\0\1\0\0\0\1\0\0\6google\3com\7kubelet\n"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 100
recvfrom(3, 0x7fff9c3f83c0, 512, 0, 0x7fff9c3f7e70, [16]) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}], 1, 2498)  = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "K\266\205\200\0\1\0\0\0\1\0\0\6google\3com\7kubelet\n"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 100
close(3)                                = 0
ioctl(1, TIOCGWINSZ, {ws_row=0, ws_col=0, ws_xpixel=0, ws_ypixel=0}) = 0
writev(1, [{iov_base="google.com: Name does not resolv"..., iov_len=33}, {iov_base="\n", iov_len=1}], 2) = 34
exit_group(0)                           = ?
+++ exited with 0 +++

[-- Attachment #3: strace_of_google-com-default-svc.txt --]
[-- Type: text/plain, Size: 5081 bytes --]

execve("./gai3a", ["./gai3a", "google.com.default.svc"], [/* 15 vars */]) = 0
arch_prctl(ARCH_SET_FS, 0x7f0198178b48) = 0
set_tid_address(0x7f0198178b80)         = 48
mprotect(0x7f0198175000, 4096, PROT_READ) = 0
mprotect(0x55a2dfb68000, 4096, PROT_READ) = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC)  = 3
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
readv(3, [{iov_base="", iov_len=0}, {iov_base="# Kubernetes-managed hosts file."..., iov_len=1024}], 2) = 202
readv(3, [{iov_base="", iov_len=0}, {iov_base="", iov_len=1024}], 2) = 0
close(3)                                = 0
open("/etc/resolv.conf", O_RDONLY|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
readv(3, [{iov_base="", iov_len=0}, {iov_base="search default.svc.cluster.local"..., iov_len=248}], 2) = 218
readv(3, [{iov_base="", iov_len=0}, {iov_base="", iov_len=248}], 2) = 0
close(3)                                = 0
socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
sendto(3, "\4\24\1\0\0\1\0\0\0\0\0\0\6google\3com\7default\3"..., 66, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 66
sendto(3, "\tI\1\0\0\1\0\0\0\0\0\0\6google\3com\7default\3"..., 66, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 66
poll([{fd=3, events=POLLIN}], 1, 2500)  = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "\4\24\201\203\0\1\0\0\0\1\0\0\6google\3com\7default\3"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 159
recvfrom(3, "\tI\201\203\0\1\0\0\0\1\0\0\6google\3com\7default\3"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 159
close(3)                                = 0
socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
sendto(3, "0f\1\0\0\1\0\0\0\0\0\0\6google\3com\7default\3"..., 58, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 58
sendto(3, "3\310\1\0\0\1\0\0\0\0\0\0\6google\3com\7default\3"..., 58, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 58
poll([{fd=3, events=POLLIN}], 1, 2500)  = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "0f\201\203\0\1\0\0\0\1\0\0\6google\3com\7default\3"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 151
recvfrom(3, "3\310\201\203\0\1\0\0\0\1\0\0\6google\3com\7default\3"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 151
close(3)                                = 0
socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
sendto(3, "m\25\1\0\0\1\0\0\0\0\0\0\6google\3com\7default\3"..., 54, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 54
sendto(3, "pc\1\0\0\1\0\0\0\0\0\0\6google\3com\7default\3"..., 54, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 54
poll([{fd=3, events=POLLIN}], 1, 2500)  = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "m\25\201\203\0\1\0\0\0\1\0\0\6google\3com\7default\3"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 147
recvfrom(3, "pc\201\203\0\1\0\0\0\1\0\0\6google\3com\7default\3"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 147
close(3)                                = 0
socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
sendto(3, "\311\20\1\0\0\1\0\0\0\0\0\0\6google\3com\7default\3"..., 76, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 76
sendto(3, "\314\262\1\0\0\1\0\0\0\0\0\0\6google\3com\7default\3"..., 76, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, 16) = 76
poll([{fd=3, events=POLLIN}], 1, 2500)  = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "\311\20\205\200\0\1\0\0\0\1\0\0\6google\3com\7default\3"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 112
recvfrom(3, 0x7ffd858042e0, 512, 0, 0x7ffd85803d90, [16]) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}], 1, 2498)  = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "\314\262\205\200\0\1\0\0\0\1\0\0\6google\3com\7default\3"..., 512, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.43.0.10")}, [16]) = 112
close(3)                                = 0
ioctl(1, TIOCGWINSZ, {ws_row=0, ws_col=0, ws_xpixel=0, ws_ypixel=0}) = 0
writev(1, [{iov_base="google.com.default.svc: Name doe"..., iov_len=45}, {iov_base="\n", iov_len=1}], 2) = 46
exit_group(0)                           = ?
+++ exited with 0 +++

  parent reply	other threads:[~2017-03-15 17:10 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
2017-03-15 16:58       ` dominic.chambers
2017-03-15 17:10       ` dominic.chambers [this message]
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=1e14e4e5bddc41518ff651e4b841c2b1@CHBARSRV1EXCHP1.ANYACCESS.NET \
    --to=dominic.chambers@glencore.com \
    --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).