# Configuring Multi-Store

{% hint style="info" %}
Since `magento-scripts` 2.2.0
{% endhint %}

## 1. Add domain to the /etc/hosts file

In order for this config to work you need to add your host domain to the `/etc/hosts` file, for example:

```bash
# /etc/hosts file
127.0.0.1 localhost
127.0.0.1 scandipwa.local # some other domain
```

## 2. Setup CMA

Multi-Store configuration is available via `storeDomains` property in `cma.js`.

You will need to put the store code as a `key` and your desired domain name as a `value` in this property, for example `admin` store key and `localhost` domain:

{% code title="cma.js" %}

```javascript
module.exports = {
    // other configurations
    storeDomains: {
        admin: 'scandipwa.local'
    }
};
```

{% endcode %}

{% hint style="danger" %}
Domain value must be pure like `google.com` or `scandipwa.local` or similar.

Subdomains can be used as well.
{% endhint %}

{% hint style="warning" %}
CMA will retrieve store codes from the `store_website` table, so make sure that the table is not empty.
{% endhint %}

That is it! Just now we have setup a domain in our application!\
Now to apply changes we need to run the [start](/getting-started/available-commands/start.md) command **without** [**-s option**](/getting-started/available-commands/start.md#s-skip-setup).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.create-magento-app.com/usage-guide/configuring-multi-store.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
