mirror of
https://github.com/mageddo/dns-proxy-server.git
synced 2026-04-26 01:45:59 +03:00
[GH-ISSUE #70] DNS resolution from inside of container #30
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#30
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 @ps1x on GitHub (May 17, 2018).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/70
Whenever i start dns-proxy-server with command provided, dns resolution from inside of other containers stops immediately. What can i do here?
UPD: repeating same in clean virtualbox machine i can not reproduce it, however new problem raises:
i can not resolve container A hostname from inside of container B
UPD2: adding this line to /etc/default/docker and restarting docker service changed things, now i am able to resolve docker hostnames, but not external (internet) hostnames like google.
DOCKER_OPTS="--dns 172.2.0.10 --dns 8.8.8.8Where 172.2.0.10 is ip of image with dns-proxy-server.
@mageddo commented on GitHub (May 17, 2018):
@ps1x
Containers that are already running or new containers?
Regards
@ps1x commented on GitHub (May 17, 2018):
Yes, i'm using docker-compose for dns-proxy-server and for my projects. Docker-compose file for dns-proxy-server:
First i'm attached to running container and within bash i try to ping google.com (ends with dns timeout) then hostname which was defined in environment variable of another container "test.lol" which succeed. Then i'm exiting container and doing same commands from host machine. Both works.
log.txt
@mageddo commented on GitHub (May 18, 2018):
Actually DPS has a limitation aside docker: DPS must be started before all containers, containers that starts before won't use DPS as default DNS
Simulating the issue
Starting DPS first don't have any issues
Workaround
A possible workaround is to all containers mount
/etc/resolv.confas readyonly as soon as DPS starts then DNS resolution will start to workMy /etc/default/docker is the default
@ps1x commented on GitHub (May 18, 2018):
Thanks for quick answer!
@mageddo commented on GitHub (May 18, 2018):
You're welcome, Did it work for you?
@ps1x commented on GitHub (Jun 6, 2018):
Yes. Thanks again.