mirror of
https://github.com/mageddo/dns-proxy-server.git
synced 2026-04-25 17:35:54 +03:00
[GH-ISSUE #68] DNS Resolution is very slow for container names -- >10 seconds #28
Labels
No labels
bug
confirmed
discussion
duplicate
enhancement
feature
feature-request
not-planned
pull-request
secondary-feature
stale
triage
waiting-feedback
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/dns-proxy-server-mageddo#28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ak2766 on GitHub (May 12, 2018).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/68
I'm testing out your DNS Proxy Server but it appears to be very slow for docker container hostname resolution. I can resolve Internet hostnames in an instant but container hostname resolution takes over 10 seconds before I start getting replies to my ping requests.
I'm on Ubuntu 16.04.4 LTS if that matters.
Let me know what I can provide to help track down the issue.
@mageddo commented on GitHub (May 12, 2018):
@ak2766 Thanks for use DPS
You take 10 seconds in which scenario? by accessing the browser, by running a
pingcommand,nslookup?I never got any delay in DNS resolution from the browser or nslookup from terminal, but I notice some delay in ping command testing it right now, please confirm your test source, then we can investigate that.
Regards
@ak2766 commented on GitHub (May 13, 2018):
Hi Mageddo.
Yes, it happens when I'm sending pings (I did mention in the post above, maybe you missed it).
I've started the
dns-proxy-serveras follows:I then started a
CentOSimage with the hostnamepingclient.example.comas follows:docker run -it --name pingclient -h pingclient.example.com -d centosI then created an image based on
CentOSwithbind-utilsandnet-tools:Then started it:
docker run -it --name pinger -h pinger.example.com -d pingerI then pinged
pingclientfrom thepingerwith the following results:As you can see, it took 12.044s to send 4 ping most of which was spent waiting for DNS to resolve the name.
If I ping an internet location -
www.google.com.au- I get responses very quickly - only 3 seconds as indicated below:So, Definitely something odd going on with container name resolution.
@ak2766 commented on GitHub (May 13, 2018):
Interestingly,
digreturns results very quickly:Yet, pinging immediately after still results in a long wait before ping replies start coming back:
@ak2766 commented on GitHub (May 13, 2018):
For completeness sake, when I ping the IP Address, response is immediate:
@ak2766 commented on GitHub (May 13, 2018):
FYI: I've just repeated the experiment with a user defined network and ping is now super responsive:
I created a user defined network as below:
docker network create dockernetI then added
--network dockernetoption as I started the containers above.This site was instrumental in my experimentation:
User Defined Bridges
Cheers,
ak.
@ak2766 commented on GitHub (May 15, 2018):
Update:
It appears that the fast response is not always guaranteed. Sometimes super fast other times I get that same ~10 second delay before I get my responses.
@mageddo commented on GitHub (May 16, 2018):
@ak2766 I think I got it.
Basically when you ping a hostname it will do a second question to DNS server asking for reverse DNS lookup eg.
2.0.18.172.in-addr.arpa., as it doesn't exists, remote server returns an error code, DPS code was with a bug that returns nothing when it receives an error code from remote server then ping timeouts after 10s and keep going.I will pre-release version 2.5.1 and keep testing.
Thank you very much for your contribution.
@mageddo commented on GitHub (May 16, 2018):
PR
@ak2766 commented on GitHub (May 19, 2018):
Thank you much more for creating a tool that makes my life really easy while getting to know Docker.
@ak2766 commented on GitHub (May 19, 2018):
I've been running this peridically (stopping and starting all containers prior to testing):
for u in {1..1000}; do ping -f -c 100 pingclient.example.com 2>&1 | egrep transmitted; doneI haven't seen a number > 2ms.
Solid fix muchly appreciated.