Skip to content

Clarify usage of ResolveHostOptions#source with App#configureHostResolver() #49055

Description

@RareScrap

Preflight Checklist

Problem Description

I want to use Session to resolve hostnames using DNS-over-HTTPS setup with configureHostResolver():

import { app, session } from 'electron';

app.whenReady().then(() => {
    configureHostResolver({
        enableBuiltInResolver: false,
        secureDnsMode: "secure", // Forced use of DNS-over-HTTPS servers only
        secureDnsServers: [
            "https://8.8.8.8/dns-query", // Google
            "https://1.1.1.1/dns-query", // CloudFlare
            "https://9.9.9.9/dns-query" // Quad9
        ]
    })

    session.defaultSession.resolveHost("google.com", {
        source: "???", // What source should be used to ensure that DNS-over-HTTPS is using?
        queryType: "A"
    })
})

Proposed Solution

Add more info for such case to the Session doc

Alternatives Considered

Not applicable

Additional Information

Struggling to find the answer by inspecting the codebase. Need help of Electron dev team.

Activity

  1. RareScrap commented on Nov 25, 2025

    @RareScrap
    ContributorAuthor

    @nikwen Can you provide some info regarding this case?

  2. RareScrap commented on Dec 17, 2025

    @RareScrap
    ContributorAuthor

    @nikwen friendly ping

  3. added a commit that references this issue on Mar 29, 2026
    0bd004f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions