3

I can ping the host:

dig registry.mynet

And the DNS server does what is expected:

dnsmasq[1]: 895 127.0.0.1/44580 query[A] registry.mynet from 127.0.0.1
dnsmasq[1]: 895 127.0.0.1/44580 /etc/hosts registry.mynet is 42.42.42.42

But if I try a more complex request, it takes a long time:

» time http -h http://registry.mynet/v2/_catalog?n=100
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 97
Content-Type: application/json; charset=utf-8
Date: Fri, 23 Mar 2018 10:42:13 GMT
Docker-Distribution-Api-Version: registry/2.0
Server: nginx/1.13.9
X-Content-Type-Options: nosniff

real    0m15.297s
user    0m0.252s
sys     0m0.028s

And this has nothing to do with the service (which is very responsive). This is because the DNS server does something strange:

dnsmasq[1]: 887 127.0.0.1/53345 query[A] registry.mynet from 127.0.0.1
dnsmasq[1]: 887 127.0.0.1/53345 /etc/hosts registry.mynet is 42.42.42.42
dnsmasq[1]: 888 127.0.0.1/53345 query[AAAA] registry.mynet from 127.0.0.1
dnsmasq[1]: 888 127.0.0.1/53345 forwarded registry.mynet to 208.67.220.220
dnsmasq[1]: 888 127.0.0.1/53345 forwarded registry.mynet to 8.8.4.4
dnsmasq[1]: 888 127.0.0.1/53345 forwarded registry.mynet to 8.8.8.8
dnsmasq[1]: 888 127.0.0.1/53345 forwarded registry.mynet to 8.8.8.8

dnsmasq[1]: 889 127.0.0.1/53345 query[A] registry.mynet from 127.0.0.1
dnsmasq[1]: 889 127.0.0.1/53345 /etc/hosts registry.mynet is 42.42.42.42
dnsmasq[1]: 890 127.0.0.1/53345 query[AAAA] registry.mynet from 127.0.0.1
dnsmasq[1]: 890 127.0.0.1/53345 forwarded registry.mynet to 208.67.220.220
dnsmasq[1]: 890 127.0.0.1/53345 forwarded registry.mynet to 8.8.4.4
dnsmasq[1]: 890 127.0.0.1/53345 forwarded registry.mynet to 8.8.8.8
dnsmasq[1]: 890 127.0.0.1/53345 forwarded registry.mynet to 8.8.8.8

dnsmasq[1]: 891 127.0.0.1/41484 query[A] registry.mynet from 127.0.0.1
dnsmasq[1]: 891 127.0.0.1/41484 /etc/hosts registry.mynet is 42.42.42.42
dnsmasq[1]: 892 127.0.0.1/58752 query[AAAA] registry.mynet from 127.0.0.1
dnsmasq[1]: 892 127.0.0.1/58752 forwarded registry.mynet to 208.67.220.220
dnsmasq[1]: 892 127.0.0.1/58752 forwarded registry.mynet to 8.8.4.4
dnsmasq[1]: 892 127.0.0.1/58752 forwarded registry.mynet to 8.8.8.8
dnsmasq[1]: 892 127.0.0.1/58752 forwarded registry.mynet to 8.8.8.8

I have two questions:

  • the DNS server does find the right answer (/etc/hosts registry.mynet is 42.42.42.42): why is processing continuing?
  • what do the "forwarded" entries mean?

1 Answer 1

1

First of all:

dig registry.mynet

Only performs IPv4 queries ([A] queries). Your dnsmasq is replying to those queries just fine. You can force dig to do AAAA queries by doing:

dig registry.mynet AAAA

From the logs, you can see that http is sending IPv4 and IPv6 queries ([AAAA] queries). Your dnsmasq is replying to the former, but not the latter maybe because you have not configured IPv6 addresses for your hosts.

You could avoid this by making sure that dnsmasq is not forwarding requests for hosts in your network:

local=/mynet/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .