mirror of
https://github.com/mageddo/dns-proxy-server.git
synced 2026-04-25 17:35:54 +03:00
[GH-ISSUE #89] Resolving container using an address from a specific network. #42
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#42
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 @wzsanders on GitHub (Oct 16, 2018).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/89
The DNS server picks an IP address arbitrarily from one of two connected networks in docker compose.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I want it to resolve the IP using a network of choice, or override it in the web interface.
If it was resolving using an IP in network1, I want it to resolve with an IP in network2.
Example:
ping containername.{domain} (172.40.200.3) becomes (172.10.0.2)
Specs:
@mageddo commented on GitHub (Oct 16, 2018):
@wsanders99 thanks for your contribution, this really is the actual behavior. I think make user able to specify the nework can be a great feature, anyway I don't know how to expose that feature friendly, we can discuss about that.
You said about user choose the network at the graphic interface, it works, but I'm thinking if there is a better way to do that, cause if user have to choose the right network every time then it will be so tedious.
A proposal, we can add the network to hostname as a suffix, example
then you can solve your hostname as it is today
Or you can specifcy from which network you want to solve it
@wzsanders commented on GitHub (Oct 17, 2018):
That would work, although it creates longer urls.
My use case is for routing to services behind a reverse proxy like traefik. These requests are coming from another container with net_admin capabilities.
It resolves correctly from the host since it can see all networks.
Since the reverse-proxy has the host name as '.acme.com' from your example
Links for services would now be in these forms, correct?
I am assuming that without the suffix, it just does what it is already doing.
This solution meets the requirements for allowing the user to choose the network that it resolves from.
However, the solution I really want is to be able to set the default network, i.e without adding the suffix to the address bar (if you want to override the default network, then I think this a solution there too).
compose example
Then it would resolve to 172.30.0.1 as it does when having network1 as the suffix in your example when using these links.
And to change the network after changing the default, append the suffix manually as .network2, etc.
@mageddo commented on GitHub (Oct 17, 2018):
Okay, I think we can build a great feature with these two options.
To make it clear for me, you proposal is that every container could set it's default network by specifying a label like
{dns-proxy-identifier}.network=network1?@wzsanders commented on GitHub (Oct 17, 2018):
Yes, that is my proposal. I very much appreciate you looking into this.
@mageddo commented on GitHub (Oct 17, 2018):
Okay, I will probably break this feature into two stories and priorize to develop the "ability to set default network on container start" first.
It's important to say and you probably already figured that out, as you are calling one container(service1) from another (reverse proxy) then both of them must be on an common network.
It's probably why you want DPS to solve container IP from another network
@mageddo commented on GitHub (Oct 17, 2018):
@wsanders99 I just released 2.8.0 can you check it out and confirm if works for you? If yes then we can close this issue
@wzsanders commented on GitHub (Oct 17, 2018):
Sorry for the delay.
I have pulled the new image and added the label
dps.network={network}to my compose file.After testing I have determined that it produces the expected behavior depending on the network set in the label.
Thank you for your quick response and implementation.
@mageddo commented on GitHub (Oct 17, 2018):
You're welcome