A class used to resolve MyDomains. After a ScratchOrg is created its host name my not be propagated to the Salesforce DNS service. This service is not exclusive to Salesforce My Domain URL and could be used for any hostname.

(async () => {
const options: MyDomainResolver.Options = {
url: new URL('http://mydomain.salesforce.com'),
timeout: Duration.minutes(5),
frequency: Duration.seconds(10)
const resolver: MyDomainResolver = await MyDomainResolver.create(options);
const ipAddress: AnyJson = await resolver.resolve();
console.log(`Successfully resolved host: ${options.url} to address: ${ipAddress}`);






  • Method that performs the dns lookup of the host. If the lookup fails the internal polling client will try again given the optional interval. Returns the resolved ip address.

    If SFDX_DISABLE_DNS_CHECK environment variable is set to true, it will immediately return the host without executing the dns loookup.

    Returns Promise<string>