Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnsdist: Support for redirects in DOH #8133

johnhtodd opened this issue Jul 28, 2019 · 2 comments · Fixed by #8153

dnsdist: Support for redirects in DOH #8133

johnhtodd opened this issue Jul 28, 2019 · 2 comments · Fixed by #8153


Copy link

johnhtodd commented Jul 28, 2019

  • Program: dnsdist
  • Issue type: Feature request

Short description

Provide support for 3xx-style redirects in DOH query responses


Being able to redirect clients to alternate servers would be useful. This could be used for load sharing/shedding, policy implementation, geographic re-location, or any of the typical features that are used in HTTP 3xx responses.


When a specific pathname regexp is requested, there needs to be a method (Lua, probably) that allows for examination of the path, examination of data about the query (IP address, HTTP headers) and then an ability to respond to the query with one of the 3xx responses that are defined by the HTTP specifications, including a custom URL constructed by logic within the dnsdist configuration model.

One specific use case would be JSON-style DNS responses, which could be handled by an external application/server if requested.

Another use case would be to redirect users to a server containing content about the DNS service policies, general contact information, etc. As it stands today, a browser query to port 443 on a DOH-enabled dnsdist server results in a non-user-friendly result.

This also could possibly serve as an ugly stand-in for 4xx style responses, so that error messages would be offloaded to a different server which would provide more useful insight into the reason the HTTPS query failed, while leaving dnsdist unburdened from those object delivery tasks.

This was discussed in chat with Habbie on July 5.

Copy link

Is this part of #8153 ? Looks like that functionality is in there... if so: great!

Copy link

rgacogne commented Aug 2, 2019

#8153 is not fully finished yet, there is at least some polishing to do, but it should allow inspection of the query (path, data, headers...) and redirects. It also supports 4xx responses, and should support sending static responses via the HTTPStatusAction, as well as dynamic responses from Lua.
In theory you could even craft your own DoH responses in Lua but I have not tested it and I'm not sure how I feel about that :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging a pull request may close this issue.

2 participants