Skip to content

feat: add app.configureHostResolver - #30576

Merged
nornagon merged 7 commits into
mainfrom
configure-host-resolver
Aug 31, 2021
Merged

nornagon merged 7 commits into
mainfrom
configure-host-resolver

Conversation

@nornagon

@nornagon nornagon commented Aug 17, 2021 •

Copy link
Copy Markdown
Contributor

Description of Change

This adds a new API, app.configureHostResolver, and also configures the host
resolver slightly differently by default:

  1. The built-in resolver is used in preference to getaddrinfo when the
    AsyncDns feature flag is enabled, which it is by default on macOS.
  2. DNS-over-HTTPS is enabled by default, which will only have an effect when
    the system provider is one of the known-to-Chromium DoH providers.
    Additionally, this respects the DnsOverHttps feature flag, along with the
    Fallback param, e.g. --enable-features=DnsOverHttps:Fallback/false to
    disable fallback to insecure DNS.
  3. DoH servers can be specified on the command line using the Templates
    feature param, e.g. --enable-features=DnsOverHttps:Templates/https%3A%2F%2Fdoh.opendns.com%2Fdns-query

The command-line functionality is left undocumented as (1) it matches Chrome
and (2) it's unclear how stable that feature is in Chrome.

Ref #21064.

Checklist

Release Notes

Notes: Added app.configureHostResolver API for configuring DNS-over-HTTPS.

Comment thread docs/api/app.md Resolved
@jkleinsc

Copy link
Copy Markdown
Member

API LGTM

@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Aug 24, 2021

@itsananderson itsananderson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback is minor

API LGTM

Comment thread docs/api/app.md Resolved
Comment thread shell/browser/api/electron_api_app.cc Resolved
Comment thread shell/browser/api/electron_api_app.cc Resolved
Comment thread docs/api/app.md Resolved
Comment thread docs/api/app.md Resolved
Comment thread docs/api/app.md Resolved
@codebytere

Copy link
Copy Markdown
Member

API LGTM

@nornagon

Copy link
Copy Markdown
Contributor Author

CI failures are unrelated. Merging.

Comment thread docs/api/app.md Resolved
@nornagon
nornagon merged commit dd7aeda into main Aug 31, 2021
@nornagon
nornagon deleted the configure-host-resolver branch August 31, 2021 18:55
@release-clerk

release-clerk Bot commented Aug 31, 2021

Copy link
Copy Markdown

Release Notes Persisted

Added app.configureHostResolver API for configuring DNS-over-HTTPS.

@trop

trop Bot commented Aug 31, 2021

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "15-x-y", please check out #30775

jkleinsc pushed a commit that referenced this pull request Sep 2, 2021
* feat: add app.configureHostResolver (#30576)

* fix tests

Co-authored-by: Jeremy Rose <[email protected]>
Co-authored-by: Jeremy Rose <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review/requested 🗳 semver/minor backwards-compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants