---
title: "Set up a custom DNS for local development"
slug: "set-up-a-custom-dns-for-local-development"
abstract: "How to set up a custom DNS on Windows and macOS when developing a Sitecore Marketplace app that uses custom authorization."
---
# Set up a custom DNS for local development

If you [decide](https://doc.sitecore.com/mp/en/developers/marketplace/app-architecture-and-authorization-options.html) to use custom authorization[^UUID-cddb7f26-63be-0002-f1bd-1044187df5fe_mp-customauth], you must set up a custom DNS for local development before creating a Marketplace app.

This is required to avoid seeing the Auth0 [user consent dialog](https://auth0.com/docs/get-started/applications/confidential-and-public-applications/user-consent-and-third-party-applications#consent-dialog) on localhost during development. Auth0 displays the consent dialog the first time the Marketplace app loads. If you load the app on localhost during development, you'll see the consent dialog. Then, if you give consent there, the Marketplace app user will not see the dialog in production. This is problematic because you need to ensure that the Marketplace app user sees the dialog. By setting up a custom DNS, you [skip seeing the consent dialog](https://auth0.com/docs/get-started/applications/confidential-and-public-applications/user-consent-and-third-party-applications#skip-consent-for-first-party-applications) during development, ensuring that the Marketplace app user will see it in production.

::::tabs
:::tab{title="Windows"}

To set up a custom DNS on Windows:

1. Open Windows PowerShell with administrator privileges.
2. Enter the command to open your Windows hosts file in your code editor:

    ```bash
    # Open in Visual Studio Code:
    code C:\Windows\System32\drivers\etc\hosts

    # Open in Cursor:
    cursor C:\Windows\System32\drivers\etc\hosts
    ```

3. In your code editor, in the `hosts` file, specify your custom DNS on a new line, and then save your changes:

    ```text
    127.0.0.1 myapp.local
    ```

    This creates a custom DNS at `https://myapp.local:3000`. Your app will run on this address.

:::
:::tab{title="macOS"}

To set up a custom DNS on macOS:

1. Open a terminal.
2. Enter the command to specify a custom DNS in your hosts file:

    ```bash
    sudo sh -c 'echo "127.0.0.1 myapp.local" >> /etc/hosts'
    ```

    This creates a custom DNS at `https://myapp.local:3000`. Your app will run on this address.

:::
::::

After setting up a custom DNS, you can create a Marketplace app.

::::tabs
:::tab{title="Custom apps"}

When [creating a custom Marketplace app](https://doc.sitecore.com/mp/en/developers/marketplace/create-a-custom-marketplace-app.html), you use the custom DNS in the following steps:

- [App configuration](https://doc.sitecore.com/mp/en/developers/marketplace/configure-and-activate-a-custom-app.html) - set the custom DNS as the **Deployment URL**.
- [Creating client credentials](https://doc.sitecore.com/mp/en/developers/marketplace/create-client-credentials.html) - add the custom DNS to the **Authorization URLs**.
- [Scaffolding an app using the Marketplace SDK](https://doc.sitecore.com/mp/en/developers/sdk/0/sitecore-marketplace-sdk/quick-start--cli-.html) - set the custom DNS as the `NEXT_PUBLIC_APP_BASE_URL` environment variable.

    In addition, in `package.json`, update `scripts.dev` to include the following flags:

    ```text
    --experimental-https --hostname myapp.local
    ```

:::
:::tab{title="Public apps"}

When [creating a public Marketplace app](https://doc.sitecore.com/mp/en/developers/marketplace/create-a-public-marketplace-app.html), you use the custom DNS in the following steps:

- [App configuration](https://doc.sitecore.com/mp/en/developers/marketplace/configure-a-public-app.html) - set the custom DNS as the **Deployment URL**.
- [Creating client credentials](https://doc.sitecore.com/mp/en/developers/marketplace/create-client-credentials.html) - add the custom DNS to the **Authorization URLs**.
- [Scaffolding an app using the Marketplace SDK](https://doc.sitecore.com/mp/en/developers/sdk/0/sitecore-marketplace-sdk/quick-start--cli-.html) - set the custom DNS as the `NEXT_PUBLIC_APP_BASE_URL` environment variable.

    In addition, in `package.json`, update `scripts.dev` to include the following flags:

    ```text
    --experimental-https --hostname myapp.local
    ```

::::

[^UUID-cddb7f26-63be-0002-f1bd-1044187df5fe_mp-customauth]: Auth0 authorization flow for Marketplace applications that replaces the built-in authorization managed by the Marketplace SDK. Required if your app needs to make server-side API calls to SitecoreAI APIs.
