FR: Config option to allow pointing to custom addresses + port for DNS servers #1866
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
bob the builder
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
continuwuation/continuwuity#1866
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?
Inherited from part of #1766
Instead of relying on
/etc/resolv.conf, I'd like a config option to specify custom addresses for DNS servers. Probably something likedns_servers = [ "9.9.9.9", "1.1.1.1", "192.168.1.53:5353" ]that falls back to the resolv file if unset.For Docker, doing this is better than clunkily mounting a custom
resolv.conf. For bare metal installs, this also allows separating c10y's resolver from rest of the system.could be tagged as good first issue maybe?
This would also need a change to resolvematrix to be implemented, as it uses the default Tokio config with resolv.conf at the moment.
FYI, Docker does allow specifically overriding DNS without clunk of resolv.conf: https://docs.docker.com/engine/network/#:~:text=%2D%2Ddns,-The .. So at least in a container context there's already a decent solution, and anything more advanced such as routing to DoH can be achieved by deploying say a
dnsdistservice, point container at it and have dnsdist route in any myriad of ways to whatever you want.@jinnatar See #1601 (comment). I believe it to still be the case
I believe the testing you performed is somewhat misleading1, but yes, ultimately you're right, with how Docker is built the internal proxy is forced for bridge networks. So as it stands it's either rendering resolv.conf yourself or giving up on custom bridge networks.
Given that the concern is that the Docker DNS proxy-ish widget is allegedly causing performance problems, then yes, the ability to bypass it could be useful. However, then the issue is more of a "Docker DNS resolution is bad" and bypassing it yourself with custom resolv.conf rendering is probably a resonable path, vs. every/any containerized software implementing direct DNS override features to work around that. It could still make sense though for Matrix server software given the "unique" load on DNS most services won't trigger though. 🤷♀️ .. So I'll take a step back, sorry for butting in into what seemed like an "easy issue". :-)
Edit: Edited for clarity since my morning brain first skipped a couple of crucial lines in the orig discussion, sorry.
Yes, it's true that in that scenario resolv.conf is pointed to an internal Docker address, but said internal resolver is then using exactly the DNS server you provided. So the server is used, it's just an allegedly less performant path. As a side curiosity to prove it's used: Point
--dnsto say an internal DNS server, installingbind-toolsin the alpine container and doing adigfor an address only the internal server would know. ↩︎FR: Config option to allow pointing to custom addresses for DNS serversto FR: Config option to allow pointing to custom addresses + port for DNS serversThanks Jinnatar for the comments. Indeed the testing was meant to show that all queries go through the internal resolver before being forwarded to their desired destinations, which is again a bottleneck of performance. I could have framed that better.
I have updated the issue to also request for custom ports, as this could benefit non-Docker deployments in order to separate different resolvers for different workloads. For example, normal resolvers can do port 53 via
/etc/resolv.conf, while Continuwuity can point itself to127.0.0.1:5353.